Skip to content

Class attribute that duplicates a base class attribute is not flagged #1338

Description

@gvanrossum

The following is not an error currently:

class C:
    a = None  # type: int
class D(C):
    a = None  # type: int  # No error

(Even though repeating the definition in C does cause an error.)
Worse, there's not even a check that the types match:

class C:
    a = None  # type: int
class D(C):
    a = None  # type: str  # Still no error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions