Message370990
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). |
|
Date |
User |
Action |
Args |
2020-06-08 14:58:25 | Adam Cmiel | set | recipients:
+ Adam Cmiel |
2020-06-08 14:58:25 | Adam Cmiel | set | messageid: <1591628305.3.0.352312564341.issue40911@roundup.psfhosted.org> |
2020-06-08 14:58:25 | Adam Cmiel | link | issue40911 messages |
2020-06-08 14:58:24 | Adam Cmiel | create | |
|