New submission from munky <munky99...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue47036>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to