Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:

>On Fri, 22 Feb 2008 11:00:17 -0800, Aahz wrote:
>
>> It's just too convenient to be able to write
>> 
>> L += ['foo']
>> 
>> without rebinding L.
>
><nitpick>But ``+=`` does rebind.</nitpick>

Usually, but there's an exception for lists, which a specific
implementation for += that calls "append".  Or do I misunderstand you?

C:\tmp>python
Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> L = [1,2,3]
>>> id(L)
10351000
>>> L += [4]
>>> id(L)
10351000
>>>
-- 
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to