[flake8-bugbear] Fix mutable-contextvar-default (B039) to resolve annotated function calls properly#14532
Merged
charliermarsh merged 5 commits intoastral-sh:mainfrom Nov 24, 2024
Merged
Conversation
Signed-off-by: harupy <hkawamura0130@gmail.com>
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
Contributor
|
flake8-bugbear] Fix mutable-contextvar-default (B039) to flag annotated function callsflake8-bugbear] Fix mutable-contextvar-default (B039) to resolve annotated function calls properly
harupy
commented
Nov 23, 2024
| && checker | ||
| .semantic() | ||
| .resolve_qualified_name(&call.func) | ||
| .resolve_qualified_name(map_subscript(&call.func)) |
Contributor
Author
There was a problem hiding this comment.
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)?
charliermarsh
approved these changes
Nov 24, 2024
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix #14525
Test Plan
New test cases