-
-
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
Correct return type of asynccontextmanager
in 3.10
#6634
Conversation
Diff from mypy_primer, showing the effect of this PR on open source code: pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/decorator.py:279: error: Module "contextlib" has no attribute "GeneratorContextManager"; maybe "_GeneratorContextManager", "ContextManager", or "AbstractContextManager"?
+ pyinstrument/vendor/decorator.py:279: error: Module "contextlib" has no attribute "GeneratorContextManager"; maybe "_GeneratorContextManager", "_AsyncGeneratorContextManager", or "ContextManager"?
|
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.
There's also a _GeneratorContextManagerBase
base class for both _GeneratorContextManager
and _AsyncGeneratorContextManager
(on Python 3.9), which is worth considering for a future PR.
Well, I had a go. You can see the results in a branch over here -- but I'm not really sure it's worth worrying about, since it seems like it breaks mypy :/ Even after adding 5
when I try to run mypy on it. |
Do you have a full stack trace on hand? |
For what it's worth, I don't think it's too important to add the |
Here's a full traceback:
|
Okay, so should be fixed come 0.930 |
I can confirm that it fixes the issue in my codebase. Thanks for the fix! 🙌 |
Fixes #6625 (I think)