Skip to content

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

Open

Description

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?

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions