[New-bugs-announce] [issue47036] Nested list in Dict, multiprocessing manager

munky report at bugs.python.org
Wed Mar 16 13:16:49 EDT 2022


New submission from munky <munky99999 at gmail.com>:

Sorry for this post but I found an unusual behaviour.

from multiprocessing import Manager
manager = Manager()

managerdict = manager.dict()

managerdict["first"]= {"stat" : [0,1]}

managerdict["first"]["stat"][0] += 1
managerdict["first"]["stat"][1] += 1

print(managerdict)

anotherdict = {}
anotherdict['foo'] = {"stat" : [0, 1]}
anotherdict['foo']["stat"][0] += 1
anotherdict['foo']["stat"][1] += 1

print(anotherdict)

Which outputs:

{'first': {'stat': [0, 1]}}
{'foo': {'stat': [1, 2]}}

What am I doing wrong?

Thanks!

----------
components: Library (Lib)
messages: 415353
nosy: munky99999
priority: normal
severity: normal
status: open
title: Nested list in Dict, multiprocessing manager
type: behavior

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


More information about the New-bugs-announce mailing list