Class Variable Access and Assignment
Fri Nov 4 11:28:32 CET 2005
Stefan Arentz <stefan.arentz at gmail.com> writes:
> > Are you seriously saying there's lots of Python projects that would
> > break if this particular weirdness were fixed?
> I have no numbers of course. But, why is this a weirdness?
Do you seriously think the number is larger than zero? Do you think
that's any good way to write code?
Examples of the weirdness have already been given. My favorite is the
one where b.a is a list instead of an integer, in which case the class
variable gets updated instead of an instance variable getting created.
If you don't find the inconsistency to be weird, then ducky for you.
More information about the Python-list