Message410861
In CLI (Command Line Interpreter):
A tuple has a list component then try to += that component. Since tuple doesn't allow assignment then it raises error but actually does that.
If you try actual equivalence (A=A+B) it does not.
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> v=([1],[2])
>>> v[0]=v[0]+[3,4]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
>>> v
([1], [2])
>>> v[0]+=[3,4]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
>>> v
([1, 3, 4], [2])
>>> |
|
Date |
User |
Action |
Args |
2022-01-18 13:28:36 | ramezaniua | set | recipients:
+ ramezaniua |
2022-01-18 13:28:36 | ramezaniua | set | messageid: <1642512516.0.0.820230309045.issue46423@roundup.psfhosted.org> |
2022-01-18 13:28:35 | ramezaniua | link | issue46423 messages |
2022-01-18 13:28:35 | ramezaniua | create | |
|