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
django.db.transaction.atomic is incompatible with contextlib.ExitStack().enter_context
django.db.transaction.atomic
contextlib.ExitStack().enter_context
Repro case:
from contextlib import ExitStack from django.db import transaction with ExitStack() as stack: stack.enter_context(transaction.atomic())
Causes:
error: Argument 1 to "enter_context" of "ExitStack" has incompatible type "Atomic"; expected "ContextManager[<nothing>]" [arg-type]
transaction.atomic() should be accepted as a valid argument to stack.enter_context as it declares the expected __enter__ and __exit__ methods.
transaction.atomic()
stack.enter_context
__enter__
__exit__
python
django
mypy
django-stubs
The text was updated successfully, but these errors were encountered:
Closed via #909
Sorry, something went wrong.
No branches or pull requests
Bug report
django.db.transaction.atomic
is incompatible withcontextlib.ExitStack().enter_context
What's wrong
Repro case:
Causes:
How is that should be
transaction.atomic()
should be accepted as a valid argument tostack.enter_context
as it declares the expected__enter__
and__exit__
methods.System information
python
version: 3.8.0django
version: 3.0.7mypy
version: 0.770django-stubs
version: 1.5.0The text was updated successfully, but these errors were encountered: