This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author andrei2peu
Recipients andrei2peu
Date 2019-02-26.10:47:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551178033.97.0.988149024615.issue36119@roundup.psfhosted.org>
In-reply-to
Content
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]}.
History
Date User Action Args
2019-02-26 10:47:13andrei2peusetrecipients: + andrei2peu
2019-02-26 10:47:13andrei2peusetmessageid: <1551178033.97.0.988149024615.issue36119@roundup.psfhosted.org>
2019-02-26 10:47:13andrei2peulinkissue36119 messages
2019-02-26 10:47:13andrei2peucreate