Re: [Python-ideas] Add os.usable_cpu_count()

2017-09-04 Thread Nathaniel Smith
On Mon, Sep 4, 2017 at 8:59 PM, Giampaolo Rodola' wrote: > Recently os.cpu_count() on Windows has been fixed in order to take process > groups into account and return the number of all available CPUs: > http://bugs.python.org/issue30581 > This made me realize that

[Python-ideas] Add os.usable_cpu_count()

2017-09-04 Thread Giampaolo Rodola'
Recently os.cpu_count() on Windows has been fixed in order to take process groups into account and return the number of all available CPUs: http://bugs.python.org/issue30581 This made me realize that os.cpu_count() does not return the number of *usable* CPUs, which could possibly represent a

Re: [Python-ideas] PEP draft: context variables

2017-09-04 Thread Nathaniel Smith
On Mon, Sep 4, 2017 at 2:50 PM, Koos Zevenhoven wrote: > Hi all, > > as promised, here is a draft PEP for context variable semantics and > implementation. Apologies for the slight delay; I had a not-so-minor > autosave accident and had to retype the majority of this first

Re: [Python-ideas] PEP draft: context variables

2017-09-04 Thread Yury Selivanov
So every generator stores "captured" modifications. This is similar to PEP 550, which adds Logical Context to generators to store their EC modifications. The implementation is different, but the intent is the same. PEP 550 uses a stack of hash tables, this proposal has a linked list of

Re: [Python-ideas] PEP draft: context variables

2017-09-04 Thread Oleg Broytman
Hi! On Tue, Sep 05, 2017 at 12:50:35AM +0300, Koos Zevenhoven wrote: > cvar = contextvars.Var(default="the default value", >description="example context variable") Why ``description`` and not ``doc``? > with cvar.assign(new_value):

[Python-ideas] PEP draft: context variables

2017-09-04 Thread Koos Zevenhoven
Hi all, as promised, here is a draft PEP for context variable semantics and implementation. Apologies for the slight delay; I had a not-so-minor autosave accident and had to retype the majority of this first draft. During the past years, there has been growing interest in something like