-
Notifications
You must be signed in to change notification settings - Fork 198
Pylance Typing checking error for AsyncTransaction #1015
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
Comments
Hi and thanks for reaching out. I'm thinking this might rather be an issue with the chosen type checker (Pylance, in your case). Reasons I'm thinking this:
Please let me know if you disagree and why. |
Thank you for your quick response I agree what you said, the bug does seem to come from However, I am wondering if the |
You are right in that |
And thank you for quickly responding and solving the issue! |
Bug Report
I am using the AsyncTransaction context manager
However, the Pylance VSCode extension (powered by Pyright) in Basic Type checking mode is giving a type error:
Object of type "AsyncTransaction" cannot be used with "with" because it does not implement __aenter__
Object of type "AsyncTransaction" cannot be used with "with" because it does not implement __aexit__
I believe that it is because
AsyncTransaction
's__aenter__
and__aexit__
are wrapped withfunctools.wraps(AsyncTransactionBase._enter)
andfunctools.wraps(AsyncTransactionBase._exit)
respectivelyMy Environment
Python Version: 3.11
Driver Version: 5.14
Operating System: macOS
The text was updated successfully, but these errors were encountered: