Class Variable Access and Assignment

Antoon Pardon apardon at forel.vub.ac.be
Fri Nov 4 08:59:09 CET 2005


Op 2005-11-04, Steve Holden schreef <steve at holdenweb.com>:
> 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.

Well I would argue that a lot of the defenders of python are not
reacting very sane. My impression is that a lot of them react like
zealots, blindly devoted to the language, rather intollerant of
every criticism and prepared to defend anything as long as it happens
to be a current characteristic of the language and where any such
criticism sooner or later is met with something like: "If you don't
like it, use a different language", as if only those who are 100%
perfectly happy with the language as it is, should use it.

>>>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?

I'm not calling anyone names. I'm just pointing to one specific
behaviour in python and call that behaviour unsane. If you want
to interpret that as me calling his (entire) design insane, I
suggest you are two defensive with regards to python.

-- 
Antoon Pardon



More information about the Python-list mailing list