I stumbled upon a Borg design and thought it would fit in well with what I was doing, however I get DeprecationWarning when using it (I am using Python 2.6 now, but will be upgrading soon).
New version found in comments:
class Borg(object): _state = {} def __new__(cls, *p, **k): self = object.__new__(cls, *p, **k) self.__dict__ = cls._state return self
However, when you create an instance with arguments, you get DepricationWarning :
DepricationWarning: object.__new__() takes no parameters
Is there a way to use a Borg project without using object.__new__() with arguments?
source share