<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Sep 29, 2018 at 8:18 AM Antoine Pitrou <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, 29 Sep 2018 08:13:19 -0400<br>
Sean Harrington <<a href="mailto:seanharr11@gmail.com" target="_blank">seanharr11@gmail.com</a>> wrote:<br>
> ><br>
> > Hmm... We might have a disagreement on the target audience of the<br>
> > multiprocessing module. multiprocessing isn't very high-level, I would<br>
> > expect it to be used by experienced programmers who know how to mutate<br>
> > a global variable from a lexical scope.<br>
> > <br>
> <br>
> >>> It is one thing to MUTATE a global from a lexical scope. No gripes <br>
> there. The specific concept I'm referencing here, is "DECLARING a global<br>
> variable, from within a lexical scope". This is not as a intuitive for most<br>
> programmers.<br>
<br>
Well, you don't have to. You can bind it to None in the top-level<br>
scope and then mutate it from the lexical scope:<br>
<br>
my_resource = None<br>
<br>
def do_work():<br>
global my_resource<br>
my_resource = ...<br>
<br></blockquote></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div>>>> Yes but this is even more constraining, as it forces the parent process to declare a global variable that it likely never uses!</div></div></blockquote><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards<br>
<br>
Antoine.<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/seanharr11%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/seanharr11%40gmail.com</a><br>
</blockquote></div></div>