[New-bugs-announce] [issue36119] Can't add/append in set/list inside shared dict
Andrei Stefan
report at bugs.python.org
Tue Feb 26 05:47:13 EST 2019
New submission from Andrei Stefan <stefan.catalinandrei at yahoo.com>:
I'm creating a shared dict for multiprocessing purposes:
from multiprocessing import Manager
manager = Manager()
shared_dict = manager.dict()
If I add a set or a list as a value in the dict:
shared_dict['test'] = set() or shared_dict['test'] = list()
I can't add/append in that set/list inside the shared dictionary:
shared_dict['test'].add(1234) or shared_dict['test'].append(1234)
The following expression:
print(dict(shared_dict))
Will return:
{'test': set()} or {'test': []}.
But if I add in the set/list using operators:
shared_dict['test'] |= {1234} or shared_dict['test'] += [1234]
It will work:
{'test': {1234}} or {'test': [1234]}.
----------
components: Build
files: image (2).png
messages: 336642
nosy: andrei2peu
priority: normal
severity: normal
status: open
title: Can't add/append in set/list inside shared dict
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48171/image (2).png
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36119>
_______________________________________
More information about the New-bugs-announce
mailing list