[New-bugs-announce] [issue45437] Assignment to a list of dictionary wrong

Xin Sheng Zhou report at bugs.python.org
Mon Oct 11 16:27:20 EDT 2021


New submission from Xin Sheng Zhou <xinshengzhou at gmail.com>:

>>> details = [{}]*4
>>> details
[{}, {}, {}, {}]
>>> details[1]['A']=5
>>> details
[{'A': 5}, {'A': 5}, {'A': 5}, {'A': 5}]
>>>

----------
messages: 403679
nosy: xinshengzhou
priority: normal
severity: normal
status: open
title: Assignment to a list of dictionary wrong
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45437>
_______________________________________


More information about the New-bugs-announce mailing list