◐ Shell
clean mode source ↗

bpo-30241: implement contextlib.AbstractAsyncContextManager by JelleZijlstra · Pull Request #1412 · python/cpython

Choose a reason for 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.

Choose a reason for 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.

Choose a reason for 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.