Why self?

Louis M. Pecora pecora at anvil.nrl.navy.mil
Tue Jul 9 08:20:25 EDT 2002


In article <mailman.1026163512.947.python-list at python.org>, Brian
Quinlan <brian at sweetapp.com> wrote:

> This would be ugly and slow. The slowness would come from the fact that
> locally scoped variables could not be identified during compilation.
> 

Ugly is in the eye of the beholder.  I think it's cleaner (a design
goal of Python as I recall).

Slow is something I cannot comment on.  I have no parsing experience so
I wasn't aware that the "solution" of "declaring" object variables in
__init__ and then using them elsewhere would have lots of overhead. 
That would be bad if it were so.



More information about the Python-list mailing list