On 7/2/2014 10:39 PM, candide wrote:
An hybrid list-tuple concatenation is not allowed

[]+(1, 2)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: can only concatenate list (not "tuple") to list




hence I was expecting (*) that the following code raises a TypeError :

x = []
x += (1, 2)
x
[1, 2]



Any explanation ?
>>> seq = [1,2]
>>> seq.extend((3,4))
>>> seq+= {5, 6}  # the order of extending is not determined
>>> seq
[1, 2, 3, 4, 5, 6]
>>>

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to