R
rs387
Hi
I'm trying to understand why it is that I can do
but not
File "<stdin>", line 1, in <module>
TypeError: can only concatenate list (not "str") to list
Can someone explain the logic? Why is the in-place add not a type
error but the usual add is? (This applies to both Python 2.6rc1 and
3.0b2)
Thanks
Roman
I'm trying to understand why it is that I can do
['s', 't', 'u', 'f', 'f']a = []
a += 'stuff'
a
but not
Traceback (most recent call last):a = []
a = a + 'stuff'
File "<stdin>", line 1, in <module>
TypeError: can only concatenate list (not "str") to list
Can someone explain the logic? Why is the in-place add not a type
error but the usual add is? (This applies to both Python 2.6rc1 and
3.0b2)
Thanks
Roman