Skip to content

Why is "incompatible with supertype" an error? #1237

Closed
@philthompson10

Description

@philthompson10

Why does mypy consider...

class Foo:
    def factory(self) -> str:
        return 'Hello'

class Bar(Foo):
    def factory(self) -> int:
        return 10

to be an error? While it may be poor design, it isn't wrong.

Thanks,
Phil

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions