ITADN

Proposed rule: match zip() arguments and unpacked variables

#545Openjenstroeger 创建于 2026-02-25
enhancementhelp wanted
J
jenstroegercommented
In an older code blob of mine I came across this oddity: ```python for a, b, _ in zip(iter_a, iter_b, iter_c): ... ``` which should be simplified to ```python for a, b in zip(iter_a, iter_b): ... ``` by removing `iter_c` entirely. Turns out I had this pattern in two other places as well 🤦🏻‍♂️ Would this not be a useful idiom to look for and warn about? (Assuming `_` isn’t used in the body of the loop…)
1 条评论