r20564 - gnucash/branches/2.4/src/optional/python-bindings - [20479] Bug #644762: Deprecated __new__() call in function_class.py
Christian Stimming
cstim at code.gnucash.org
Sun Apr 17 15:05:18 EDT 2011
Author: cstim
Date: 2011-04-17 15:05:18 -0400 (Sun, 17 Apr 2011)
New Revision: 20564
Trac: http://svn.gnucash.org/trac/changeset/20564
Modified:
gnucash/branches/2.4/src/optional/python-bindings/function_class.py
Log:
[20479] Bug #644762: Deprecated __new__() call in function_class.py
Patch by Sara Arenson:
Patch to fix the deprecated __new__() call in function_class.py
When you create an object of type ClassFromFunctions (a subclass of object),
you get the following warning:
/opt/gnucash-2.4.0/lib/python2.6/site-packages/gnucash/function_class.py:55:
DeprecationWarning: object.__new__() takes no parameters
return super(ClassFromFunctions, cls).__new__(cls, *args, **kargs)
As per Python docs (http://docs.python.org/reference/datamodel.html), __new__()
accepts class name and a list of arguments for the object's constructor. Since
ClassFromFunctions's superclass's constructor has no arguments, we should not
be passing *args and **kargs.
More information about the gnucash-patches
mailing list