Tasks
-
Normal
Bug report
#43
Invalid call to __new__ method for singleton classes
trunk Resolved and closed
2010-03-20 11:34:41
Anonymous user
@ThibG

@ThibG
Hi,
Each singleton class in bluemindo calls the __new__ method of its parent, in order to forward arguments and keyword arguments.
However, it's broken, as it forwards them as a list, and a dict, instead of forwarding them as arguments and keyword arguments.
(cls.ref = super(ConfigLoader, cls).__new__(cls, *args, **kws) instead of cls.ref = super(ConfigLoader, cls).__new__(cls, args, kws) would do it)
Furthermore, each of these classes inherits only from object, that triggers a DeprecationWarning since python 2.6 if __new__ is called with arguments.
So, I would propose to replace all those overcomplicated calls by "cls.ref = object.__new__(cls)".
Each singleton class in bluemindo calls the __new__ method of its parent, in order to forward arguments and keyword arguments.
However, it's broken, as it forwards them as a list, and a dict, instead of forwarding them as arguments and keyword arguments.
(cls.ref = super(ConfigLoader, cls).__new__(cls, *args, **kws) instead of cls.ref = super(ConfigLoader, cls).__new__(cls, args, kws) would do it)
Furthermore, each of these classes inherits only from object, that triggers a DeprecationWarning since python 2.6 if __new__ is called with arguments.
So, I would propose to replace all those overcomplicated calls by "cls.ref = object.__new__(cls)".
2011-03-15 12:10:38
- Milestone changed to 0.4
2011-09-11 03:30:58
This bug was fixed by the commit r131. This is an automatic fix.
Add an attachement
Post to this thread
This bug has been resolved.
This bug report has been closed by a developer.
Being resolved or rejected, this report has been closed by a developer, thus you may not need to add an answer.