A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-March/147505.html below:

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

[Python-Dev] API design: where to add async variants of existing stdlib APIs? [Python-Dev] API design: where to add async variants of existing stdlib APIs?Yury Selivanov yselivanov.ml at gmail.com
Wed Mar 1 10:34:04 EST 2017
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 the existing module
> - would anyone object strongly to my asking authors of the affected PRs to
> take their changes in that direction?

Both asynccontextmanager and AsyncExitStack do not require asyncio is 
their implementations.  Using asyncio as a helper to write tests is 
totally OK.  For example, I use asyncio to test asynchronous generators 
(PEP 525).

async/await is a generic language feature; asyncio is a framework that 
uses it.  Things like asynccontextmanager are framework agnostic, they 
can be used in programs built with asyncio, Twisted, Tornado, etc.

+1 to put both in contextlib.

Yury
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4