Open DetachHead opened 3 years ago
def func(a: T, b: T) -> T:
return a
reveal_type([1], []) # object
reveal_type([1], cast(list[int], [])) # list[int]
I think mypy if failing to inject the type parameter of the first list into the partial type(list[<nothing>]
) of the second list.
https://mypy-play.net/?mypy=latest&python=3.10&flags=strict%2Ccheck-untyped-defs%2Cdisallow-any-decorated%2Cdisallow-any-expr%2Cdisallow-any-explicit%2Cdisallow-any-generics%2Cdisallow-any-unimported%2Cdisallow-incomplete-defs%2Cdisallow-subclassing-any%2Cdisallow-untyped-calls%2Cdisallow-untyped-decorators%2Cdisallow-untyped-defs%2Cno-strict-optional%2Cwarn-incomplete-stub%2Cwarn-redundant-casts%2Cwarn-return-any%2Cwarn-unreachable%2Cwarn-unused-configs%2Cwarn-unused-ignores&gist=67ab7f5ec1dfea275e0d318ffadc1b18