[PEP 203] Augmented Assignment: Names Needed!

Aahz Maruch aahz at netcom.com
Tue Aug 15 01:51:08 EDT 2000


In article <B5BE354C.7AB7%dgoodger at bigfoot.com>,
David Goodger  <dgoodger at bigfoot.com> wrote:
>
>IMHO the proposed __add_ab__ is awkward, needs explanation, and hard to type
>(not *another* underscore, please!). The various 'in-place' versions are
>misleading, I find, because for immutable objects 'a += 1' is *not* in-place
>at all, just a shortcut for 'a = a + 1'. The rebinding of the name to a new
>object is still there. How about renaming the internals as well for
>consistency, changing (for example) bytecode INPLACE_ADD to AUG_ADD, or
>PyNumber_InPlaceAdd to PyNumber_AugmentedAdd?

Well, I would argue that in the case of a user-defined object, it's only
in the rare cases that it needs to be hashable that it's immutable (and
even then only the *hash* needs to be immutable, not the object).  The
kind of people playing games like that will certainly understand that
"inplace" isn't literally accurate.

Granted that strings and integers won't be "inplace" -- but someone
who's dealing with Python only at that level won't know what those weird
opcodes are.
--
                      --- Aahz (Copyright 2000 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

Gun-toting Naderite / socialized medicine libertarian



More information about the Python-list mailing list