Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-10 Thread Koos Zevenhoven
On Wed, Mar 1, 2017 at 7:42 AM, Nick Coghlan wrote: > Short version: > > - there are some reasonable requests for async variants of contextlib APIs > for 3.7 > - prompted by Raymond, I'm thinking it actually makes more sense to add > these in a new `asyncio.contextlib` module

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-07 Thread Nick Coghlan
On 8 March 2017 at 04:15, Ethan Furman wrote: > On 03/07/2017 09:41 AM, Brett Cannon wrote: > > I don't think a common practice has bubbled up yet for when there's both >> synchronous and asynchronous versions of an API >> (closest I have seen is appending an "a" to the async

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-07 Thread Nathaniel Smith
On Tue, Mar 7, 2017 at 9:41 AM, Brett Cannon wrote: > I don't think a common practice has bubbled up yet for when there's both > synchronous and asynchronous versions of an API (closest I have seen is > appending an "a" to the async version but that just looks like a spelling >

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-07 Thread Sven R. Kunze
On 07.03.2017 19:37, Jelle Zijlstra wrote: 2017-03-07 10:15 GMT-08:00 Ethan Furman >: On 03/07/2017 09:41 AM, Brett Cannon wrote: I don't think a common practice has bubbled up yet for when there's both synchronous and

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-07 Thread Jelle Zijlstra
2017-03-07 10:15 GMT-08:00 Ethan Furman : > On 03/07/2017 09:41 AM, Brett Cannon wrote: > > I don't think a common practice has bubbled up yet for when there's both >> synchronous and asynchronous versions of an API >> (closest I have seen is appending an "a" to the async

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-07 Thread Ethan Furman
On 03/07/2017 09:41 AM, Brett Cannon wrote: I don't think a common practice has bubbled up yet for when there's both synchronous and asynchronous versions of an API (closest I have seen is appending an "a" to the async version but that just looks like a spelling mistake to me most of the

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-07 Thread Brett Cannon
I don't think a common practice has bubbled up yet for when there's both synchronous and asynchronous versions of an API (closest I have seen is appending an "a" to the async version but that just looks like a spelling mistake to me most of the time). This is why the question of whether separate

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-07 Thread Michel Desmoulin
Last week I had to download a CSV from an FTP and push any update on it using websocket so asyncio was a natural fit and the network part went well. The surprise was that the CSV part would not work as expected. Usually I read csv doing: import csv file_like_object = csv_crawler.get_file() for

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-06 Thread Guido van Rossum
On Mon, Mar 6, 2017 at 5:57 PM, Raymond Hettinger < raymond.hettin...@gmail.com> wrote: > Of course, it makes sense that anything not specific to asyncio should go > outside of asyncio. > > What I'm more concerned about is what the other places actually are. > Rather than putting async variants

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-06 Thread Raymond Hettinger
> On Mar 1, 2017, at 8:47 AM, Yury Selivanov wrote: > >> IMHO this is a good idea*iff* the new APIs really are bound to >> asyncio, rather than being generic across all uses of async/await. > > I agree. There is no need to make asynccontextmanager and >

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-01 Thread Nick Coghlan
On 2 March 2017 at 02:29, Barry Warsaw wrote: > On Mar 01, 2017, at 10:55 AM, Victor Stinner wrote: > > >I suggest to create 3rd party modules on PyPI. It became easy to pull > >dependencies using pip and virtualenv. > > > >It seems like https://github.com/aio-libs is the home

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-01 Thread Barry Warsaw
On Mar 01, 2017, at 10:55 AM, Victor Stinner wrote: >I suggest to create 3rd party modules on PyPI. It became easy to pull >dependencies using pip and virtualenv. > >It seems like https://github.com/aio-libs is the home of many asyncio >libraries. This is what we did for aiosmtpd, an

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-01 Thread Paul Moore
On 1 March 2017 at 15:34, Yury Selivanov wrote: > +1 to put both in contextlib. With the proviso that the implementation shouldn't depend on asyncio. As Yury says, it should be framework agnostic, let's be careful to make that the case and not rely on helpers from

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-01 Thread Yury Selivanov
On 2017-03-01 2:16 AM, Nathaniel Smith wrote: On Tue, Feb 28, 2017 at 9:42 PM, Nick Coghlan wrote: Short version: - there are some reasonable requests for async variants of contextlib APIs for 3.7 - prompted by Raymond, I'm thinking it actually makes more sense to add

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-01 Thread Yury Selivanov
On 2017-03-01 12:42 AM, Nick Coghlan wrote: Short version: - there are some reasonable requests for async variants of contextlib APIs for 3.7 - prompted by Raymond, I'm thinking it actually makes more sense to add these in a new `asyncio.contextlib` module than it does to add them directly to

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-03-01 Thread Victor Stinner
Please don't put code using asyncio in Python stdlib yet. The Python language is still changing rapidly to get new async features (async/await keywords, async generators, etc.), and asyncio also evolved quickly. I suggest to create 3rd party modules on PyPI. It became easy to pull dependencies

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-02-28 Thread Nathaniel Smith
On Tue, Feb 28, 2017 at 9:42 PM, Nick Coghlan wrote: > Short version: > > - there are some reasonable requests for async variants of contextlib APIs > for 3.7 > - prompted by Raymond, I'm thinking it actually makes more sense to add > these in a new `asyncio.contextlib` module

Re: [Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-02-28 Thread Ethan Furman
On 02/28/2017 09:42 PM, Nick Coghlan wrote: So would folks be OK with my asking the author of the PR for https://bugs.python.org/issue29679 (adding asynccontextmanager) to rewrite the patch to add it as asyncio.contextlib.asyncontextmanager (with a cross-reference from the synchronous

[Python-Dev] API design: where to add async variants of existing stdlib APIs?

2017-02-28 Thread Nick Coghlan
Short version: - there are some reasonable requests for async variants of contextlib APIs for 3.7 - prompted by Raymond, I'm thinking it actually makes more sense to add these in a new `asyncio.contextlib` module than it does to add them directly to the existing module - would anyone object