Skip to content
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

consider-using-enumerate doesn't trigger if iterated object is an attribute #3657

Closed
natedogith1 opened this issue May 29, 2020 · 0 comments · Fixed by #4508
Closed

consider-using-enumerate doesn't trigger if iterated object is an attribute #3657

natedogith1 opened this issue May 29, 2020 · 0 comments · Fixed by #4508
Labels
Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors Help wanted 🙏 Outside help would be appreciated, good for new contributors
Milestone

Comments

@natedogith1
Copy link

consider-using-enumerate isn't triggered if the iterated object is more complex than just a variable name. (for instance, if it's a property on an object)

pylint 2.4.4
astroid 2.3.3
Python 3.7.3+ (heads/3.7:e64d21b187, Apr 23 2019, 10:57:08)

def foo(arg):
    for i in range(len(arg.bar)): # fails to trigger consider-using-enumerate
        b = arg.bar[i]
@PCManticore PCManticore added Good first issue Friendly and approachable by new contributors Enhancement ✨ Improvement to a component labels May 29, 2020
@Pierre-Sassoulas Pierre-Sassoulas added the Help wanted 🙏 Outside help would be appreciated, good for new contributors label Mar 2, 2021
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.8.3 milestone May 26, 2021
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.8.3, 2.9.0 May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors Help wanted 🙏 Outside help would be appreciated, good for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants