Class Variable Access and Assignment

Steve Holden steve at holdenweb.com
Thu Nov 3 23:59:33 EST 2005


Antoon Pardon wrote:
> Op 2005-11-03, Stefan Arentz schreef <stefan.arentz at gmail.com>:
[...]
>>It is all according to how things have been in Python for a long time.
> 
> Unsane behaviour for a long time is still unsane behaviour.
> 
As your continued contributions on this newsgroup so adequately 
demonstrate :-).

Sorry, I *couldn't* resist. You asked for it. It was hanging there (in a 
containing namespace?) waiting to be posted. If I hadn't said it someone 
else would have. And other justifications for what I hope doesn't seem 
like too unpleasant a personal attack.
> 
>>The real issue here is that you should propery name class variables so
>>that there can't be any confusion about class or instance scope. I use
>>all uppercase identifiers for class variables for example.
> 
> 
> The fact that this can be regarded as unwise coding, doesn't imply
> it is sane behaviour of python. Variable shadowing happens. I don't
> consider it sane behaviour if the same reference in a line gets
> resolved in different name spaces
> 
Well I'm sure Guido will be happy to know you think his design is 
insane. Now who's calling who names?

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list