Skip to content

PEP 647: Error if overriding typeguard with non-typeguard in subclass #9928

Closed
@gvanrossum

Description

@gvanrossum

See #9865. (UPDATED)

I believe we should issue an error in this case.

See (disabled) test:

[case testTypeGuardMethodOverride-skip]
from typing_extensions import TypeGuard
class C:
def is_float(self, a: object) -> TypeGuard[float]: pass
class D(C):
def is_float(self, a: object) -> bool: pass # E: Some error
[builtins fixtures/tuple.pyi]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions