Unexpected result for list operator "+="

Alex Martelli aleaxit at yahoo.com
Thu Jan 4 09:12:43 EST 2001


"Fredrik Lundh" <fredrik at effbot.org> wrote in message
news:aDW46.2901$AH6.510940 at newsc.telia.net...
    [snip]
> 1) if anyone can figure out where list += is documented,
> let us know...

I only see a very brief & indirect mention in passing at 3.3.4
in the Python Reference Manual -- online version's URL
http://www.python.org/doc/current/ref/sequence-types.html

"""
Finally, sequence types should implement addition (meaning concatenation)
[snip]
by defining the methods __add__(), __radd__(), __iadd__(),
"""
(it continues by saying the methods are 'described below',
but, they aren't).

Still better than the docs for numeric types -- this is the
ONLY mention I can find of __iadd__ *anywhere* in the docs.


Alex






More information about the Python-list mailing list