[SciPy-user] fsolve and additional parameters
matt
matt at hotdispatch.com
Mon Jul 19 18:56:08 EDT 2004
My mistake. This seems to work now. Thanks for the help.
-Matt
On Jul 19, 2004, at 6:46 PM, Fernando Perez wrote:
> matt wrote:
>> class subclassname(superclassname):
>> def equations(self,x)
>> return self,x
>
> You probably want to use something like
>
> def equations(self,x):
> return x
>
> Note that your pseudocode was lacking ':' at the end of the def.
>
> You might want to read up a bit on python's object model to understand
> better how 'self' is passed around, since your questions are more
> related to handling of methods in python than to fsolve itself.
>
> Note that you rarely return 'self', and when you do, it's typically
> returned alone (not with additional things) for purposes of method
> chaining:
>
> foo.meth1().meth2().meth3()
>
> can only be done if each of methN returns self (or some suitable copy
> thereof).
>
> HTH.
>
> Best,
>
> f
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>
More information about the SciPy-User
mailing list