-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
affects-typeshedAnything that blocks a typeshed changeAnything that blocks a typeshed changebugmypy got something wrongmypy got something wrongtopic-inheritanceInheritance and incompatible overridesInheritance and incompatible overrides
Description
The following program is type safe:
from typing import overload
class A: ...
class B: ...
class Parent:
def dst(self, x: A | B) -> int | None: ...
class Child(Parent):
@overload
def dst(self, x: A) -> int: ...
@overload
def dst(self, x: B) -> None: ...
This came up in python/typeshed#9862
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affects-typeshedAnything that blocks a typeshed changeAnything that blocks a typeshed changebugmypy got something wrongmypy got something wrongtopic-inheritanceInheritance and incompatible overridesInheritance and incompatible overrides