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
_______________________________________________
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

Reply via email to