From: Chris B. <chr...@gm...> - 2006-01-24 11:00:20
|
On 23/01/06, Ricardo Kirkner <ric...@gm...> wrote: > Hi: > > I want to create a subclass of ode.Body. I have written a class > I get the error: > > TypeError: function takes exactly 1 argument (0 given) PyODE uses Pyrex to wrap the C ODE library in python classes. From http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/version/Doc/specia= l_methods.html "Keep in mind that any arguments passed to the constructor will be passed to the __new__ method as well as the __init__ method. If you anticipate subclassing your extension type in Python, you may find it useful to give the __new__ method * and ** arguments so that it can accept and ignore extra arguments. Otherwise, any Python subclass which has an __init__ with a different signature will have to override __new__ as well as __init__, which the writer of a Python class wouldn't expect to have to do." You can find the ode.Body wrapper in the pyode source at src/body.pyx |