-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix potential-index-error
false positive when iterable contains starred element
#10097
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10097 +/- ##
=======================================
Coverage 95.80% 95.80%
=======================================
Files 174 174
Lines 18962 18973 +11
=======================================
+ Hits 18166 18177 +11
Misses 796 796
|
This comment has been minimized.
This comment has been minimized.
d627b12
to
9e865b4
Compare
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit 9e865b4 |
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.
Looks great, thank you!
Type of Changes
Description
The current implementation calculates the length of an indexed iterable by using its literal length. However, this approach fails when the iterable contains a starred element that unpacks into multiple elements.
For example:
This PR addresses the issue by extending the check to account for the inferred length of starred nodes within the indexed iterable.
Closes #10076