newbie: self.member syntax seems /really/ annoying

David wizzardx at
Wed Sep 12 12:34:52 CEST 2007

> Please help if I am missing something -- this looks like a great
> language but I am going to mad trying to read numerical code full of
> 'self.'s breaking up the equations.

You could try this in your functions:

s = self

Then you can use code like this: s.a_dot = s.k(s.a-s.u)

Another option, if you use the vars a lot in a given function, is to
copy them to local vars. This can also slightly speed up your code
(fewer member lookups).

More information about the Python-list mailing list