r20479 - gnucash/trunk/src/optional/python-bindings - Bug #644762: Deprecated __new__() call in function_class.py

Christian Stimming cstim at code.gnucash.org
Fri Mar 25 15:57:08 EDT 2011


Author: cstim
Date: 2011-03-25 15:57:07 -0400 (Fri, 25 Mar 2011)
New Revision: 20479
Trac: http://svn.gnucash.org/trac/changeset/20479

Modified:
   gnucash/trunk/src/optional/python-bindings/function_class.py
Log:
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