-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[flake8-bugbear
] Fix mutable-contextvar-default (B039)
to resolve annotated function calls properly
#14532
Conversation
Signed-off-by: harupy <[email protected]>
flake8-bugbear
] Fix mutable-contextvar-default (B039)
to handle annotated callsflake8-bugbear
] Fix mutable-contextvar-default (B039)
to handle annotated calls properly
flake8-bugbear
] Fix mutable-contextvar-default (B039)
to handle annotated calls properlyflake8-bugbear
] Fix mutable-contextvar-default (B039)
to flag annotated function calls
|
flake8-bugbear
] Fix mutable-contextvar-default (B039)
to flag annotated function callsflake8-bugbear
] Fix mutable-contextvar-default (B039)
to resolve annotated function calls properly
@@ -96,7 +97,7 @@ pub(crate) fn mutable_contextvar_default(checker: &mut Checker, call: &ast::Expr | |||
&& !is_immutable_func(func, checker.semantic(), &extend_immutable_calls))) | |||
&& checker | |||
.semantic() | |||
.resolve_qualified_name(&call.func) | |||
.resolve_qualified_name(map_subscript(&call.func)) |
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.
Unrelated to this PR, but shoud we check if call.func
is contextvars.Contextvar
first (and exit if not) before checking if arguments
has a keyword default
to avoid unnecessary work (immutability check and extending the immutable expressions)?
Thanks! |
Summary
Fix #14525
Test Plan
New test cases