Nick Coghlan added the comment:

It's probably worth a python-dev discussion, but I personally draw the line at 
"Does this need to import 'asyncio'?". If it does, then that's a clear 
dependency inversion, and the functionality doesn't belong in a relatively low 
level module like contextlib.

If it doesn't, then I think the potentially tricky part of this kind of code is 
the way it interacts with the execution stack and the context management 
machinery, so it makes sense for it to live in contextlib and have a design and 
review process that's closely aligned with that for the corresponding 
synchronous APIs.

That said, one of my review comments on the PR was that the new test cases 
should be split out to their own file to avoiding making the existing tests 
depend on asyncio, which I'd consider a point in favour of adding an 
`asyncio.contextlib` module instead of adding these APIs directly to contextlib.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29679>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to