-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use Self in async context managers #5724
Conversation
@@ -103,9 +101,9 @@ if sys.version_info >= (3, 7): | |||
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ... | |||
def callback(self, callback: Callable[..., Any], *args: Any, **kwds: Any) -> Callable[..., Any]: ... | |||
def push_async_callback(self, callback: _CallbackCoroFunc, *args: Any, **kwds: Any) -> _CallbackCoroFunc: ... | |||
def pop_all(self: _S) -> _S: ... | |||
def pop_all(self: Self) -> Self: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is on _BaseExitStack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of _BaseExitStack
is to avoid copy/pasta in the implementation. On the one hand, we don't need it in typeshed because the stubs are short anyway, but on the other hand, it is generally good if stubs match the implementation. Either way, adding _BaseExitStack
is beyond the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be fixed on both copies of pop_all instead
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Resolves this comment #5712 (comment)