[New-bugs-announce] [issue36715] Dictionary initialization

Aditya Sane report at bugs.python.org
Wed Apr 24 15:49:57 EDT 2019


New submission from Aditya Sane <aditya.sane at gmail.com>:

When initializing a dictionary with dict.fromkeys, if an object is used as initial value, then the value is taken by reference instead of by value.
This results in incorrect behavior since Python doesn't have "by reference" or pointers by default.
Attached file shows an example and one work-around.

----------
files: DictionaryBug.py
messages: 340805
nosy: Aditya Sane
priority: normal
severity: normal
status: open
title: Dictionary initialization
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48286/DictionaryBug.py

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


More information about the New-bugs-announce mailing list