-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
CheckersRelated to a checkerRelated to a checkerEnhancement ✨Improvement to a componentImprovement to a componentGood first issueFriendly and approachable by new contributorsFriendly and approachable by new contributorsHacktoberfestHelp wanted 🙏Outside help would be appreciated, good for new contributorsOutside help would be appreciated, good for new contributorsNeeds specification 🔐Accepted as a potential improvement, and needs to specify edge cases, message names, etc.Accepted as a potential improvement, and needs to specify edge cases, message names, etc.
Description
Is your feature request related to a problem? Please describe
iterator = (ord(char) for char in string.printable)
for spam in range(10):
for eggs in iterator: # this won't work as expected and is really hard to catch!
print(chr(spam*eggs))
Describe the solution you'd like
W\d+: Repeatedly looping through iterator (looping-through-iterator)
Additional context
I realize it's easy to have false positives here, but if we limit to cases where it's clear that it's a non-infinite iterator (e.g. list(iterable)
, comprehensions, for loops without return/break/continue) I think the main problem is that I could have used range(1) above and that would give a false positive, but that seems like fairly bad style anyway.
RumovZ
Metadata
Metadata
Assignees
Labels
CheckersRelated to a checkerRelated to a checkerEnhancement ✨Improvement to a componentImprovement to a componentGood first issueFriendly and approachable by new contributorsFriendly and approachable by new contributorsHacktoberfestHelp wanted 🙏Outside help would be appreciated, good for new contributorsOutside help would be appreciated, good for new contributorsNeeds specification 🔐Accepted as a potential improvement, and needs to specify edge cases, message names, etc.Accepted as a potential improvement, and needs to specify edge cases, message names, etc.