[issue41543] contextlib.nullcontext doesn't work with async context managers

2020-11-09 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 ___ Python tracker ___

[issue41543] contextlib.nullcontext doesn't work with async context managers

2020-11-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset a117167d8dc8fa673a4646f509551c7950f824e5 by Tom Gringauz in branch 'master': bpo-41543: contextlib.nullcontext can fill in for an async context manager (GH-21870)

[issue41543] contextlib.nullcontext doesn't work with async context managers

2020-08-13 Thread Nathaniel Smith
Nathaniel Smith added the comment: It does seem pretty harmless in this case. -- ___ Python tracker ___ ___ Python-bugs-list

[issue41543] contextlib.nullcontext doesn't work with async context managers

2020-08-13 Thread Yury Selivanov
Yury Selivanov added the comment: I typically don't like objects that support both `with` and `async with`, but in this case I think that's appropriate. Nathaniel, Andrew, what do you think? -- nosy: +njs ___ Python tracker

[issue41543] contextlib.nullcontext doesn't work with async context managers

2020-08-13 Thread Tom Gringauz
Change by Tom Gringauz : -- keywords: +patch pull_requests: +20995 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21870 ___ Python tracker ___

[issue41543] contextlib.nullcontext doesn't work with async context managers

2020-08-13 Thread Tom Gringauz
New submission from Tom Gringauz : `contextlib.nullcontext` cannot be used with async conetext managers, because it implements only `__enter__` and `__exit__`, and doesn't implement `__aenter__` and `__aexit__`. -- components: Library (Lib), asyncio messages: 375346 nosy: asvetlov,