Static variable vs Class variable

bambam david at asdf.asdf
Fri Oct 19 02:38:53 CEST 2007



"Steven D'Aprano" <steve at REMOVE-THIS-cybersource.com.au> wrote in message 
news:13hbvu6oc742l02 at corp.supernews.com...
> On Wed, 17 Oct 2007 13:41:06 +0200, Hrvoje Niksic wrote:
>
>> The current implementation of += uses __add__ for addition and __iadd__
>> for addition that may or may not be in-place.  I'd like to know the
>> rationale for that design.
>
> Everything you need is in the PEP:
>
> http://www.python.org/dev/peps/pep-0203/
>
>
>
> -- 
> Steven.

Which illustrates that the proposal, while simplified for implementation,
is not exactly what was desired*

""" is both more readable and less error prone, because it is
    instantly obvious to the reader that it is <x> that is being
    changed, and not <x> that is being replaced
"""

As we see from this thread, it is not instantly obvious to the reader;
the meaning of "changed, not replaced" is ambiguous.

[david]

* That is, unless ambiguity was the desideratum 





More information about the Python-list mailing list