newbie: self.member syntax seems /really/ annoying

Jeremy Sanders jeremy+complangpython at jeremysanders.net
Wed Sep 12 14:17:55 CEST 2007


Charles Fox wrote:

> I've just started playing around with Python, as a possible
> replacement for a mix of C++, Matlab and Lisp.  The language looks
> lovely and clean with one huge exception:  I do a lot of numerical
> modeling, so I deal with objects (like neurons) described
> mathematically in papers, by equations like

I thought it was horrible when I started, but now when looking at somebody
else's C++ code I find it very hard to work out whether something is a
global, a member or a local variable, unless they use some sort of naming
convention.

If you alias self as "s", it's only two more characters per variable access,
which is the same as the C++ "m_" naming convention.

-- 
Jeremy Sanders
http://www.jeremysanders.net/



More information about the Python-list mailing list