Szabolcs Nagy wrote:
>>>> L=[1]
>>>> L.extend((1,))
>>>> L
> [1, 1]

Are list.extend() and list concatenation supposed to behave differently? 
I always thought concatenation was just shorthand for calling extend().

However the following seems to work:

 >>> L = [1]
 >>> L += (2,)
 >>> L
     [1, 2]

It seems like the '+' operator for lists should accept any iterable for 
the right side argument to be consistent with extend() and the '+=' 
operator.

-Farshid
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to