-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-45756: Fix mock triggers dynamic lookup via the descriptor protocol. #31348
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
Conversation
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.
Isn't it the same as #29901 ?
I think this is a good example of using |
This PR is similar to #22209 . I check the difference between I found that they behave differently when
I don't know which behavior is more reasonable. |
for attr in dir(spec): | ||
if iscoroutinefunction(getattr(spec, attr, None)): | ||
_spec_asyncs.append(attr) | ||
for attr, _ in inspect.getmembers_static(spec, iscoroutinefunction): |
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.
What about async classmethods? Would those still get recognized as coroutines?
Thanks for the PR! I think we should consolidate the discussion to #22209. If we do this, we should prefer continuing to use Also, I think the async-classmethod case is not fixable using Closing as duplicate of #22209. |
https://bugs.python.org/issue45756