This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年09月24日 14:20 by Владимир.Тырин, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg227451 - (view) | Author: Владимир Тырин (Владимир.Тырин) | Date: 2014年09月24日 14:20 | |
This behavior seems to be very strange.
>>> l = [1, 2, 3]
>>> t = ('a', l)
>>> t
('a', [1, 2, 3])
>>> t[1] += [4]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
>>> t
('a', [1, 2, 3, 4])
|
|||
| msg227452 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2014年09月24日 14:22 | |
See https://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:08 | admin | set | github: 66671 |
| 2014年09月24日 14:22:16 | ezio.melotti | set | status: open -> closed nosy: + ezio.melotti messages: + msg227452 resolution: not a bug stage: resolved |
| 2014年09月24日 14:20:48 | Владимир.Тырин | create | |