Followup to #8343. The example there seems fixed in the newest (1.1.371) release of pyright, but just adding an extra argument seems to break it:
from typing import overload
class Base2:
@overload
def __init_subclass__(cls, x: str, y: str) -> None: ...
@overload
def __init_subclass__(cls, x: int, y: int) -> None: ...
def __init_subclass__(cls, x: int | str, y: int | str) -> None: ...
class Subclass2(Base2, x=3, y=3): ... # An unexpected pyright error!
Where on the last line we get the errors:
error: Incorrect keyword arguments for __init_subclass__ method (reportGeneralTypeIssues)
error: No overloads for "__init_subclass__" match the provided arguments (reportCallIssue)
error: Argument of type "Literal[3]" cannot be assigned to parameter "y" of type "str" in function "__init_subclass__"
Followup to #8343. The example there seems fixed in the newest (
1.1.371
) release of pyright, but just adding an extra argument seems to break it:Where on the last line we get the errors:
I'm using Pyright 1.1.371, Python 3.12.