GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-30241: implement contextlib.AbstractAsyncContextManager by JelleZijlstra · Pull Request #1412 · python/cpython Conversation
|
|
@JelleZijlstra, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ncoghlan, @birkenfeld and @rhettinger to be potential reviewers. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| def __subclasshook__(cls, C): | ||
| if cls is AbstractAsyncContextManager: | ||
| if (any("__aenter__" in B.__dict__ for B in C.__mro__) and | ||
| any("__aexit__" in B.__dict__ for B in C.__mro__)): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I understand you just copied this from above, but I think both should be updated to support the explicit "anti-registration" __enter__ = None pattern, like all classes in collections.abc, see _check_methods function in _collections_abc.py.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe that should be a separate issue? AbstractContextManager should arguably be fixed even in 3.6, and this PR only targets 3.7. I can fix AbstractAsyncContextManager though.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, a separate PR for 3.6 is needed. But I think it makes sense to already fix the async version here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Filed http://bugs.python.org/issue30266 to track that.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Wait, isn't this a new feature that should go into 3.7? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Oh yes, sorry, this one is not urgent then. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Implements: - python/typing#438 - python/cpython#360 python/cpython#1412, which adds contextlib.AbstractAsyncContextManager, has not yet been merged.
) Implements: - python/typing#438 - python/cpython#360 Note that python/cpython#1412, which adds contextlib.AbstractAsyncContextManager, has not yet been merged.
|
Please add a NEWS entry and I'll merge this in. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks, just pushed a NEWS entry. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| .. class:: AbstractAsyncContextManager | ||
|
|
||
| An :term:`abstract base class` similar to |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we could just copy the paragraph from AbstractContextManager doc. "similar to" isn't easy to read here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The PR #4790 adds |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@JelleZijlstra Could you please fix the merge conflict and update the docs as @1st1 proposed? I would like to have this merged soon. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @JelleZijlstra! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks, and sorry for dropping the ball on making the docs change! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
NP ;) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you @JelleZijlstra and @1st1 ! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.