pylint-bot / pylint-unofficial

UNOFFICIAL playground for pylint github migration
0 stars 0 forks source link

Add a message for using enumerate instead of range and len #684

Closed pylint-bot closed 8 years ago

pylint-bot commented 9 years ago

Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore)



pylint-bot commented 9 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


Add a new convention message, 'consider-using-enumerate'

The message is emitted when code that uses range and len for iterating is encountered, which can be easily simplified by using enumerate instead. This makes the code a bit faster and cleaner. Closes issue #684.