Re: [Python-Dev] [Python-checkins] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796)

2018-10-12 Thread Eric V. Smith
> On Oct 12, 2018, at 7:03 PM, Martin Panter wrote: > >> On 12/10/2018, Eric V. Smith wrote: >>> On 10/12/2018 5:17 AM, Tal Einat wrote: >>> >>> The latest stable releases can always be found on the `Python download page >>> -`_. There are two recommended

Re: [Python-Dev] [Python-checkins] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796)

2018-10-12 Thread Martin Panter
On 12/10/2018, Eric V. Smith wrote: > On 10/12/2018 5:17 AM, Tal Einat wrote: > >> The latest stable releases can always be found on the `Python download page >> -`_. There are two recommended >> production-ready >> -versions at this point in time, because

Re: [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-12 Thread Nathaniel Smith
On Fri, Oct 12, 2018, 06:09 Antoine Pitrou wrote: > On Fri, 12 Oct 2018 08:33:32 -0400 > Sean Harrington wrote: > > Hi Nathaniel - this if this solution can be made performant, than I would > > be more than satisfied. > > > > I think this would require removing "func" from the "task tuple", and

[Python-Dev] Summary of Python tracker Issues

2018-10-12 Thread Python tracker
ACTIVITY SUMMARY (2018-10-05 - 2018-10-12) Python tracker at https://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open6824 (+10) closed 39893 (+49) total 46717 (+59) Open issues

Re: [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-12 Thread Antoine Pitrou
Le 12/10/2018 à 16:49, Sean Harrington a écrit : > Yes - “func” (and “self” which func is bound to) would be copied to each > child worker process, where they are stored and applied to each element > of the iterable being mapped over. Only if it has changed, then, right? I suspect that would

Re: [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-12 Thread Sean Harrington
Yes - “func” (and “self” which func is bound to) would be copied to each child worker process, where they are stored and applied to each element of the iterable being mapped over. On Fri, Oct 12, 2018 at 10:41 AM Antoine Pitrou wrote: > On Fri, 12 Oct 2018 09:42:50 -0400 > Sean Harrington

Re: [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-12 Thread Antoine Pitrou
On Fri, 12 Oct 2018 09:42:50 -0400 Sean Harrington wrote: > I would contend that this is much more granular than Dask - this is just an > optimization of Pool.map() to avoid redundantly passing the same `func` > repeatedly, once per task, to each worker, with the primary goal of > eliminating

Re: [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-12 Thread Sean Harrington
I would contend that this is much more granular than Dask - this is just an optimization of Pool.map() to avoid redundantly passing the same `func` repeatedly, once per task, to each worker, with the primary goal of eliminating redundant serialization of large-memory-footprinted Callables. This is

Re: [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-12 Thread Antoine Pitrou
Le 12/10/2018 à 15:17, Sean Harrington a écrit : > The implementation details need to be flushed out, but agnostic of > these, do you believe this a valid solution to the initial problem? Do > you also see it as a beneficial optimization to Pool, given that we > don't need to store

Re: [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-12 Thread Sean Harrington
The implementation details need to be flushed out, but agnostic of these, do you believe this a valid solution to the initial problem? Do you also see it as a beneficial optimization to Pool, given that we don't need to store funcs/bound-methods/partials on the tasks themselves? The latter

Re: [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-12 Thread Antoine Pitrou
On Fri, 12 Oct 2018 08:33:32 -0400 Sean Harrington wrote: > Hi Nathaniel - this if this solution can be made performant, than I would > be more than satisfied. > > I think this would require removing "func" from the "task tuple", and > storing the "func" "once per worker" somewhere globally

Re: [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-12 Thread Sean Harrington
Hi Nathaniel - this if this solution can be made performant, than I would be more than satisfied. I think this would require removing "func" from the "task tuple", and storing the "func" "once per worker" somewhere globally (maybe a class attribute set post-fork?). This also has the beneficial

Re: [Python-Dev] [Python-checkins] bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796)

2018-10-12 Thread Eric V. Smith
On 10/12/2018 5:17 AM, Tal Einat wrote: The latest stable releases can always be found on the `Python download page -`_. There are two recommended production-ready -versions at this point in time, because at the moment there are two branches of -stable

Re: [Python-Dev] Arbitrary non-identifier string keys when using **kwargs

2018-10-12 Thread Steven D'Aprano
On Thu, Oct 11, 2018 at 01:27:08PM -0400, Chris Barker - NOAA Federal via Python-Dev wrote: > > On the server side, the application could be doing something like > > assuming that the kwargs are e.g. column names > > This is exactly a use-case for non-identifier strings in kwargs. Why not just

Re: [Python-Dev] Arbitrary non-identifier string keys when using **kwargs

2018-10-12 Thread Samuele Pedroni
On Thu, Oct 4, 2018 at 10:58 AM Steven D'Aprano wrote: > While keyword arguments have to be identifiers, using **kwargs allows > arbitrary strings which aren't identifiers: > > py> def spam(**kwargs): > ... print(kwargs) > ... > py> spam(**{"something arbitrary": 1, '\n': 2}) > {'something