Skip to content

Distinguish between attributes of a class and attributes of its instances #1097

@mrwright

Description

@mrwright

The following typechecks:

class A(object):
    def __init__(self):
        # type: () -> None
        self.X = 0 # type: int

x = A.X

even though X is not an attribute of the class A, just an attribute of its instances, and the x = A.X line causes an AttributeError when executed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions