Skip to content

Overriding a property with method is not flagged #8386

Closed

Description

@ottmihkel

I recently ran into an issue by accidentally omitting a @Property decorator when overriding a property, like eg:

class A:
@Property
def foo(self) -> bool:
return True

class B(A):
def foo(self) -> bool:
return False

b = B()

bool(b.foo)
True

Wouldn't it make sense to have mypy emit a warning, at least optionally?

Activity

  1. ilevkivskyi commented on Feb 12, 2020

    @ilevkivskyi
    Member

    This is essentially a duplicate of #7565

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions