-
-
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
False positive nested-min-max
for nested lists
#9307
Comments
I wonder if we can recommend itertools.chain.from_iterable() here instead. Thanks for the clear report. |
Isnt't max(max(a)) more elegant ? Should we consider this a false positive ? |
I haven't benchmarked itertools but I would assume it's better than iterating twice. chain.from_iterable is marginally uglier, but I would guess that when people prefer explicitness over performance they'd probably disable the whole check. Thoughts? |
Ha sure, sometime I don't remember or it's unclear what the goal of a check is. perfs and readability are sometime incompatible. |
Nesting is useful for finding the maximum in a matrix. Therefore, pylint allows nesting of the form: max(max([[1, 2, 3], [4, 5, 6]])) Closes pylint-dev#9307
Nesting is useful for finding the maximum in a matrix. Therefore, pylint allows nesting of the form: max(max([[1, 2, 3], [4, 5, 6]])) Closes #9307 Co-authored-by: Pierre Sassoulas <[email protected]>
Nesting is useful for finding the maximum in a matrix. Therefore, pylint allows nesting of the form: max(max([[1, 2, 3], [4, 5, 6]])) Closes #9307 Co-authored-by: Pierre Sassoulas <[email protected]> (cherry picked from commit da13c74)
Nesting is useful for finding the maximum in a matrix. Therefore, pylint allows nesting of the form: max(max([[1, 2, 3], [4, 5, 6]])) Closes #9307 Co-authored-by: Pierre Sassoulas <[email protected]> (cherry picked from commit da13c74) Co-authored-by: Udi Fuchs <[email protected]>
Bug description
Configuration
No response
Command used
Pylint output
Expected behavior
Pylint gives wrong advice. If
a
is a nest list,max(max(a))
is not equivalentmax(*a)
.Pylint version
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: