[New-bugs-announce] [issue41423] `multiprocessing.Array` and `multiprocessing.managers.SyncManager.Array` APIs are similar but not the same

James Thistlewood report at bugs.python.org
Tue Jul 28 14:34:04 EDT 2020


New submission from James Thistlewood <jamesthistlewood at gmail.com>:

I stumbled across this by trying to implement a call to the latter, while reading the docs for the former.

I think this is quite confusing and unnecessary that the APIs between these two definitions should differ.  The same goes for `multiprocessing.Value` and `multiprocessing.managers.SyncManager.Value`.

This is especially exacerbated by the fact that the docs _are incorrect_. On this page [1], under 'Server process', a link to 'Array' is made. If it were correct, it would link to `multiprocessing.managers.SyncManager.Array`, since it's talking about a manager object - the kind returned by `Manager()`. But it links to `multiprocessing.Array`. Of course, the simple solution would be to change the link to link to the correct place, but I think this shows an unnecessary inconsistency in the API itself.

I don't have a PR for this yet, nor have I fully investigated, but should it be feasible I would like to implement it myself. I'm interested to hear what people think.

[1] https://docs.python.org/3/library/multiprocessing.html#sharing-state-between-processes

----------
components: Library (Lib)
messages: 374519
nosy: jthistle
priority: normal
severity: normal
status: open
title: `multiprocessing.Array` and `multiprocessing.managers.SyncManager.Array` APIs are similar but not the same
type: behavior
versions: Python 3.8

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


More information about the New-bugs-announce mailing list