Closed as not planned
Description
Mypy errors with Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader [misc]
for the following class:
from typing import Optional, Union, overload
class Transform:
@overload
def apply(self, b: bytes) -> bytes:
"""Return the transformed bytestring of the input"""
@overload
def apply(self, b: bytearray) -> None:
"""Transform the input bytearray in place"""
def apply(self, b: Union[bytes, bytearray]) -> Optional[bytes]:
pass
Changing the order of the two @overload
doesn't give the error.
mypy --version
mypy 0.981 (compiled: yes)
Metadata
Metadata
Assignees
Labels
No labels