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

False positive on Enum.__members__.items() #4123

Closed
daneah opened this issue Feb 22, 2021 · 3 comments · Fixed by #4135, tingvarsson/telegram.ongabot#33, hypothesis/checkmate#227 or freelawproject/courtlistener#1620
Labels
Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code
Milestone

Comments

@daneah
Copy link

daneah commented Feb 22, 2021

Steps to reproduce

  1. Create an Enum subclass
  2. Try to iterate over the Enum contents using MyEnum.__members__.items()
  3. Lint the code

Current behavior

observe E1101: Function '__members__' has no 'items' member (no-member)

Expected behavior

Iterating over an Enum per the Python docs does not result in a linting error.

pylint --version output

pylint 2.7.0
astroid 2.5
@ikraduya
Copy link
Contributor

I can make a patch about this issue

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.7.2 milestone Feb 23, 2021
@Pierre-Sassoulas Pierre-Sassoulas added Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code labels Feb 23, 2021
@postlund
Copy link

I'm facing the same issue, but with values instead of items. Would expect it's the same for keys as well.

@VladimirSlavik
Copy link

I have __members__[something] which gives me unsubscriptable-object. I guess everything under __members__ is invisible...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment