We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
__{a}exit__
I have checked that my issue does not already have a solution in the FAQ
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
4.0.0a4
Passing an AsyncScheduler instance to AsyncExitStack.enter_async_context results in:
AsyncScheduler
AsyncExitStack.enter_async_context
src/infra/__init__.py:61: error: Argument 1 to "enter_async_context" of "AsyncExitStack" has incompatible type "AsyncScheduler"; expected "AbstractAsyncContextManager[AsyncScheduler]" [arg-type] src/infra/__init__.py:61: note: Following member(s) of "AsyncScheduler" have conflicts: src/infra/__init__.py:61: note: Expected: src/infra/__init__.py:61: note: def __aexit__(self, type[BaseException] | None, BaseException | None, TracebackType | None, /) -> Coroutine[Any, Any, bool | None] src/infra/__init__.py:61: note: Got: src/infra/__init__.py:61: note: def __aexit__(self, type[BaseException], BaseException, TracebackType, /) -> Coroutine[Any, Any, None]
To conform to the ABC the args received by the exit method must be union with None.
None
async with AsyncExitStack() as stack: scheduler = AsyncScheduler() scheduler = await stack.enter_async_context(scheduler)
The text was updated successfully, but these errors were encountered:
Makes __{a}exit__ method args nullable.
8f1b6c5
This makes the methods compatible with typeshed's ABCs: https://github.com/python/typeshed/blob/5e9589dd75f8a5f39a38a2ed45f098ff62babc7f/stdlib/contextlib.pyi#L40-L54 Closes agronholm#874
Made __{a}exit__ method args nullable. (#875)
0c647c9
This makes the methods compatible with typeshed's ABCs: https://github.com/python/typeshed/blob/5e9589dd75f8a5f39a38a2ed45f098ff62babc7f/stdlib/contextlib.pyi#L40-L54 Closes #874.
Successfully merging a pull request may close this issue.
Things to check first
I have checked that my issue does not already have a solution in the FAQ
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Version
4.0.0a4
What happened?
Passing an
AsyncScheduler
instance toAsyncExitStack.enter_async_context
results in:To conform to the ABC the args received by the exit method must be union with
None
.How can we reproduce the bug?
The text was updated successfully, but these errors were encountered: