Using this python example snippet below, I'm getting the error at the bottom
from typing import List
def foo(x:List[float]):
pass
i=[3]
foo(i)
.
[Pyright] Argument of type "list[int]" cannot be assigned to parameter "x" of type "List[float]" in function "foo"
TypeVar "_T@list" is invariant
"int" is incompatible with "float" (5:4)
lsp-pyright: 20220614.1545
PEP 484 Type Hints specifically states that:
Rather than requiring that users write import numbers and then use
numbers.Floatetc., this PEP proposes a straightforward shortcut that is almost as effective: when an argument is annotated as having typefloat, an argument of typeintis acceptable; similar, for an argument annotated as having type complex, arguments of type float or int are acceptable.