Code sample in pyright playground mypy playground
class Foo[X, Y = object]:
def test(self) -> None:
reveal_type(Foo[Y, X]()) # Foo[X`1, X`1]
class Bar[X = object, Y = object]:
def test(self) -> None:
reveal_type(Bar[Y, X]()) # Bar[Y`2 = builtins.object, Y`2 = builtins.object]
Expected:
Foo[Y@Foo, X@Foo]
Bar[Y@Bar, X@Bar]
Related issue: #19362