Class Variable Access and Assignment

Stefan Arentz stefan.arentz at gmail.com
Fri Nov 4 05:02:28 EST 2005


Antoon Pardon <apardon at forel.vub.ac.be> writes:

...

> Would it be too much to ask that in a line like.
> 
>   x = x + 1.
> 
> both x's would resolve to the same namespace?

This is starting to look more like a nagging contest than a real
discussion imo.

Consider changing the semantics of what you are proposing and
think about all those Python projects that will break because they
depend on the above behaviour and even take advantage of it.

So in short: yes, it would be too much to ask :-)

But, you can fix it in your own code. Simply make sure that your
class variables have different names or a prefix.

 S.



More information about the Python-list mailing list