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 Adam Cmiel
Recipients Adam Cmiel
Date 2020-06-08.14:58:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591628305.3.0.352312564341.issue40911@roundup.psfhosted.org>
In-reply-to
Content
Python version:

Python 3.8.3 (default, May 15 2020, 00:00:00) 
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux

Description:

When assigning to a tuple index using +=, if the element at that index is a list, the list is extended and a TypeError is raised.

a = ([],)
try:
    a[0] += [1]
except TypeError:
    assert a != ([1],)  # assertion fails
else:
    assert a == ([1],)

The expected behaviour is that only one of those things would happen (probably the list being extended with no error, given that a[0].extend([1]) works fine).
History
Date User Action Args
2020-06-08 14:58:25Adam Cmielsetrecipients: + Adam Cmiel
2020-06-08 14:58:25Adam Cmielsetmessageid: <1591628305.3.0.352312564341.issue40911@roundup.psfhosted.org>
2020-06-08 14:58:25Adam Cmiellinkissue40911 messages
2020-06-08 14:58:24Adam Cmielcreate