Message131055
Using += to append to a list inside a tuple raises a TypeError but succeeds in appending the value anyway:
>>> t = (1, [2, 3, 4])
>>> t[1].append(5)
>>> t[1] += [6]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
>>> t
(1, [2, 3, 4, 5, 6])
I have reproduced this on all the Python interpreters available to me (CPython 2.6, 2.7, and 3.1). |
|
Date |
User |
Action |
Args |
2011-03-15 22:20:49 | scgtrp | set | recipients:
+ scgtrp |
2011-03-15 22:20:49 | scgtrp | set | messageid: <1300227649.12.0.439926761488.issue11562@psf.upfronthosting.co.za> |
2011-03-15 22:20:47 | scgtrp | link | issue11562 messages |
2011-03-15 22:20:47 | scgtrp | create | |
|