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

Emit no-member for __annotations__ for py-version < 3.10 #9928

Open
l0lawrence opened this issue Sep 16, 2024 · 1 comment
Open

Emit no-member for __annotations__ for py-version < 3.10 #9928

l0lawrence opened this issue Sep 16, 2024 · 1 comment
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Minor 💅 Polishing pylint is always nice py-version typing

Comments

@l0lawrence
Copy link

I have the following code, with py-version=3.8 specified in my pylintrc:

my_dictionary: TypeOfSomeClass = {}


if key in my_dictionary.__annotations__:  # pylint: disable=no-member
    some code

When I run this in a python 3.8 environment, pylint is happy with no-member being disabled.
When I run this in a python 3.10 environment I get a useless-supression error due to the disable on __annotations. .__annotations changes for python 3.10 and above.

Both of these are accurate, however, with py-version=3.8 specified I would expect the same results on python 3.8 and python 3.10. Am I misinterpreting the scope of py-version, is no-member not a version dependent check?

@jacobtylerwalls
Copy link
Member

Thanks for the report. Your analysis is correct; this is just a missing feature.

@jacobtylerwalls jacobtylerwalls added Minor 💅 Polishing pylint is always nice py-version labels Sep 16, 2024
@jacobtylerwalls jacobtylerwalls changed the title py-version applying to no-member? Emit no-member for __annotations__ for py-version <= 3.10 Sep 16, 2024
@jacobtylerwalls jacobtylerwalls added False Negative 🦋 No message is emitted but something is wrong with the code typing labels Sep 16, 2024
@jacobtylerwalls jacobtylerwalls changed the title Emit no-member for __annotations__ for py-version <= 3.10 Emit no-member for __annotations__ for py-version < 3.10 Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Minor 💅 Polishing pylint is always nice py-version typing
Projects
None yet
Development

No branches or pull requests

2 participants