Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Nick Coghlan
On 17 January 2018 at 11:27, Nathaniel Smith wrote: > On Tue, Jan 16, 2018 at 2:44 PM, Yury Selivanov > wrote: >> 4. ContextVar.reset(token) now raises a ValueError if the token was >> created in a different Context. > > A minor bit of polish: given that

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Guido van Rossum
On Tue, Jan 16, 2018 at 5:33 PM, Yury Selivanov wrote: > On Tue, Jan 16, 2018 at 8:27 PM, Nathaniel Smith wrote: > [..] > > token = cvar.set(...) > > token.reset() > > I see the point, but I think that having the 'reset' method defined on > the

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Yury Selivanov
On Tue, Jan 16, 2018 at 8:27 PM, Nathaniel Smith wrote: [..] > token = cvar.set(...) > token.reset() I see the point, but I think that having the 'reset' method defined on the ContextVar class is easier to grasp. It also feels natural that a pair of set/reset methods is defined

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Nathaniel Smith
On Tue, Jan 16, 2018 at 2:44 PM, Yury Selivanov wrote: > 4. ContextVar.reset(token) now raises a ValueError if the token was > created in a different Context. A minor bit of polish: given that Token objects have to track the associated ContextVar anyway, I think it'd be

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Nathaniel Smith
On Tue, Jan 16, 2018 at 5:06 PM, Yury Selivanov wrote: > On Tue, Jan 16, 2018 at 7:45 PM, Guido van Rossum wrote: >> On Tue, Jan 16, 2018 at 4:37 PM, Antoine Pitrou wrote: >>> >>> On Tue, 16 Jan 2018 17:44:14 -0500 >>> Yury

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Yury Selivanov
On Tue, Jan 16, 2018 at 7:45 PM, Guido van Rossum wrote: > On Tue, Jan 16, 2018 at 4:37 PM, Antoine Pitrou wrote: >> >> On Tue, 16 Jan 2018 17:44:14 -0500 >> Yury Selivanov wrote: >> >> > Offloading execution to other threads >> >

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Yury Selivanov
Thanks, Victor! ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Yury Selivanov
On Tue, Jan 16, 2018 at 6:53 PM, Guido van Rossum wrote: > On Tue, Jan 16, 2018 at 3:26 PM, Victor Stinner [..] >> I don't think that it's worth it to prevent misuage of reset(). IMHO >> it's fine if calling reset() twice reverts the variable state

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Guido van Rossum
On Tue, Jan 16, 2018 at 4:37 PM, Antoine Pitrou wrote: > On Tue, 16 Jan 2018 17:44:14 -0500 > Yury Selivanov wrote: > > > Offloading execution to other threads > > - > > > > It is possible to run code in a

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Antoine Pitrou
On Tue, 16 Jan 2018 17:44:14 -0500 Yury Selivanov wrote: > Offloading execution to other threads > - > > It is possible to run code in a separate OS thread using a copy > of the current thread context:: > > executor =

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Guido van Rossum
On Tue, Jan 16, 2018 at 3:26 PM, Victor Stinner wrote: > Thanks for the updated PEP v3, it's now much better than PEP v2! > > I have no more complain against your PEP. I vote +1 for PEP 567 > contextvars! > Yeah! > The only open question I personally have is whether

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Victor Stinner
Hi Yury, Thanks for the updated PEP v3, it's now much better than PEP v2! I have no more complain against your PEP. I vote +1 for PEP 567 contextvars! > The only open question I personally have is whether ContextVar.reset() > should be idempotent or not. Maybe we should be strict and raise an

[Python-Dev] PEP 567 v3

2018-01-16 Thread Yury Selivanov
Hi, This is a third version of PEP 567. Changes from v2: 1. PyThreadState now references Context objects directly (instead of referencing _ContextData). This fixes out of sync Context.get() and ContextVar.get(). 2. Added a new Context.copy() method. 3. Renamed Token.old_val property to

Re: [Python-Dev] Python 3.7: Require OpenSSL >=1.0.2 / LibreSSL>=2.5.3

2018-01-16 Thread Steve Dower
I think you mean out-of-band updates, and by “you” I'm going to pretend you mean PyCA ;) Top-posted from my Windows phone From: Christian Heimes Sent: Tuesday, January 16, 2018 21:42 To: python-dev@python.org Subject: Re: [Python-Dev] Python 3.7: Require OpenSSL >=1.0.2 / LibreSSL>=2.5.3 On

Re: [Python-Dev] Python 3.7: Require OpenSSL >=1.0.2 / LibreSSL >=2.5.3

2018-01-16 Thread Steve Dower
Honestly, I’d rather plug into the WinHTTP API and just not even bother with sockets :) Certificate validation is about the only thing broken in OpenSSL on Windows (as far as not working well with system config), and it’s relatively easy to replace with a couple of API calls. Now that we don’t

Re: [Python-Dev] Python 3.7: Require OpenSSL >=1.0.2 / LibreSSL >= 2.5.3

2018-01-16 Thread Christian Heimes
FYI, master on Travis CI now builds and uses OpenSSL 1.1.0g [1]. I have created a daily cronjob to populate Travis' cache with OpenSSL builds. Until the cache is filled, Linux CI will take an extra 5 minute. Christian [1] https://github.com/python/cpython/pull/5180

Re: [Python-Dev] Python 3.7: Require OpenSSL >=1.0.2 / LibreSSL >= 2.5.3

2018-01-16 Thread Wes Turner
On Tuesday, January 16, 2018, Christian Heimes wrote: > On 2018-01-16 12:28, Wes Turner wrote: > > > > > > On Tuesday, January 16, 2018, Steve Dower > > wrote: > > > > From my perspective, we can’t keep an

Re: [Python-Dev] Python 3.7: Require OpenSSL >=1.0.2 / LibreSSL >= 2.5.3

2018-01-16 Thread Christian Heimes
On 2018-01-16 12:28, Wes Turner wrote: > > > On Tuesday, January 16, 2018, Steve Dower > wrote: > > From my perspective, we can’t keep an OpenSSL-like API and use > Windows platform libraries (we *could* do a requests-like API

Re: [Python-Dev] Python 3.7: Require OpenSSL >=1.0.2 / LibreSSL >= 2.5.3

2018-01-16 Thread Wes Turner
On Tuesday, January 16, 2018, Steve Dower wrote: > From my perspective, we can’t keep an OpenSSL-like API and use Windows > platform libraries (we *could* do a requests-like API easily enough, but > even urllib3 is painfully low-level). > > Support for Windows SChannel

Re: [Python-Dev] Python 3.7: Require OpenSSL >=1.0.2 / LibreSSL >=2.5.3

2018-01-16 Thread Christian Heimes
On 2018-01-16 08:08, Steve Dower wrote: > From my perspective, we can’t keep an OpenSSL-like API and use Windows > platform libraries (we *could* do a requests-like API easily enough, but > even urllib3 is painfully low-level). > >   > > We have to continue shipping our own copy of OpenSSL on

Re: [Python-Dev] Best Python API for exposing posix_spawn

2018-01-16 Thread Pablo Galindo Salgado
Thank you everyone that commented in this thread about the best interface for posix_spawn. I have finished implementing Antoine's suggestion in the PR: https://github.com/python/cpython/pull/5109 I think it would be good if we can have this merged before the feature lock at the end of the month