[Python-Dev] bpo-34837: Multiprocessing.Pool API Extension (original) (raw)
[Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals
Sean Harrington seanharr11 at gmail.com
Sat Sep 29 08:26:06 EDT 2018
- Previous message (by thread): [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals
- Next message (by thread): [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Sep 29, 2018 at 8:18 AM Antoine Pitrou <solipsis at pitrou.net> wrote:
On Sat, 29 Sep 2018 08:13:19 -0400 Sean Harrington <seanharr11 at gmail.com> wrote: > > > > Hmm... We might have a disagreement on the target audience of the > > multiprocessing module. multiprocessing isn't very high-level, I would > > expect it to be used by experienced programmers who know how to mutate > > a global variable from a lexical scope. > > > > >>> It is one thing to MUTATE a global from a lexical scope. No gripes > there. The specific concept I'm referencing here, is "DECLARING a global > variable, from within a lexical scope". This is not as a intuitive for most > programmers.
Well, you don't have to. You can bind it to None in the top-level scope and then mutate it from the lexical scope: myresource = None def dowork(): global myresource myresource = ... >>> Yes but this is even more constraining, as it forces the parent process to declare a global variable that it likely never uses!
Regards
Antoine.
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/seanharr11%40gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20180929/106083bb/attachment-0001.html>
- Previous message (by thread): [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals
- Next message (by thread): [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]