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

Raymond Hettinger raymond.hettinger at gmail.com
Mon Mar 6 20:57:39 EST 2017


> On Mar 1, 2017, at 8:47 AM, Yury Selivanov <yselivanov.ml at gmail.com> 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
> AsyncExitStack dependent on asyncio or specific to asyncio.
> 
> They should both stay framework agnostic (use only protocols
> defined by PEP 492 and PEP 525) and both shouldn't be put
> into asyncio package.

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 of everything sprinkled all over the standard library, I suggest collecting them all together, perhaps in a new asynctools module.


Raymond


More information about the Python-Dev mailing list