All Questions
6 questions
4
votes
1
answer
194
views
Alpha finance trader singleton
I used to write singleton in Python, which actually Alpha only need to initialize once and the trading bot will run forever. For example in main.py:
...
5
votes
2
answers
519
views
Singleton metaclass for each argument set compatible with Pickle
I am creating a metaclass which ensures that instances of an actual class A are kind of singletons. But rather than having only single instance of ...
2
votes
1
answer
4k
views
Singleton method for Redis connection in Python
Here's my class for providing a singleton instance of a Redis connection. What do you think?
...
3
votes
1
answer
2k
views
Singleton base class
I just wrote a singleton base class for a hobby project I'm currently working on. Python is not my first language, which is why I am not sure if everything is done the pythonic way.
I also used ...
1
vote
1
answer
629
views
Creating a singleton container class for intrer-class messaging
My question is for validation of my code (any loop holes / bugs) and guidance the best methodology to implement for my requirement.
I am developing a Python application that will have many classes. ...
4
votes
4
answers
4k
views
Singleton Decorator
I've written a class that makes writing singletons easy. The class is meant to be used as a decorator (example below). I'd like to see your thoughts about the code, the documentation, and everything ...