newbie: self.member syntax seems /really/ annoying

Carsten Haese carsten at uniqsys.com
Thu Sep 13 14:35:06 EDT 2007


On Thu, 2007-09-13 at 09:05 -0700, Charles Fox wrote:
> when you are implementing a model from a published
> paper, the variables tend to be single greek or roman letter names,
> possibly with subscripts and superscripts, and it helps if the name
> you see on the screen is the same as the name on the paper, as is the
> case in matlab.  You want the equation on screen to look as similar to
> the one on the paper as possible, especially if its going to be read
> by another programmer who is familiar with the paper.

In that case, you could/should move the calculations into a function
that uses local variables, instead of a method that uses instance
attributes. Accessing local variables is faster than accessing instance
attributes, and you get rid of the annoying self prefix.

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list