Skip to content

(🐞) no error when overriding read only property with attribute not initialised in class body #13230

@KotlinIsland

Description

@KotlinIsland
class Foo: 
    @property
    def foo(self) -> int: ...
class Bar(Foo):
    foo: int
    def __init__(self) -> None:
       self.foo = 2  # runtime error
Bar()

playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-descriptorsProperties, class vs. instance attributes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions