newbie: self.member syntax seems /really/ annoying

Charles Fox charles.fox at gmail.com
Wed Sep 12 10:43:51 EDT 2007


Thanks guys -- yeah these two stategies (short s.varname; and explicit
rescoping, a=self.a etc) are more or less what I was using.  That's
still kind of annoying though.

The s.varname approach still makes numerical code much harder to read.

I had a nasty bug with the boilerplate approach when forgetting to
reassign some of the variables back to members (self.a=a).  And that's
a lot of boilerplate you need -- I thought the python way was to
minimize redundant code?  (Ditching header files and curley brackets
was a main reason for me coming here).

I see the argument for making self explicit -- what would be wrong
with just .a instead of self.a though?  That's still explicit but much
easier to read.  (I think I've seen that somewhere else, is it C#?)




More information about the Python-list mailing list