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.

Author ramezaniua
Recipients ramezaniua
Date 2022-01-18.13:28:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642512516.0.0.820230309045.issue46423@roundup.psfhosted.org>
In-reply-to
Content
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])
>>>
History
Date User Action Args
2022-01-18 13:28:36ramezaniuasetrecipients: + ramezaniua
2022-01-18 13:28:36ramezaniuasetmessageid: <1642512516.0.0.820230309045.issue46423@roundup.psfhosted.org>
2022-01-18 13:28:35ramezaniualinkissue46423 messages
2022-01-18 13:28:35ramezaniuacreate