A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-September/155352.html below:

[Python-Dev] bpo-34837: Multiprocessing.Pool API Extension

[Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o GlobalsAntoine Pitrou solipsis at pitrou.net
Sat Sep 29 08:17:59 EDT 2018
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:

my_resource = None

def do_work():
    global my_resource
    my_resource = ...

Regards

Antoine.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4