Hi,
I am having problems using propagate with lists and the source of the issue seems to be the Indexable class used for typehinting. For instance:
from jacobi._typing import Indexable
def foo(x: Indexable[float]) -> float:
return x[0]
my_list: list[float] = [1.0, 2.0, 3.0]
foo(my_list)
shows me:
Argument of type "list[float]" cannot be assigned to parameter "x" of type "Indexable[float]" in function "foo" "list[float]" is not assignable to "Indexable[float]"
and it seems that the class needs to implement len. In any case, there seems to be two ways around:
- Use
Sequence from typing.
- Use a
Protocol class with __getitem__ and len.
So I would just remove this class and use either 1 or 2.
Hi,
I am having problems using
propagatewith lists and the source of the issue seems to be the Indexable class used for typehinting. For instance:shows me:
and it seems that the class needs to implement
len. In any case, there seems to be two ways around:Sequencefrom typing.Protocolclass with__getitem__andlen.So I would just remove this class and use either 1 or 2.