Open CatBraaain opened 2 months ago
I tried this code
pip install git+https://github.com/EntilZha/PyFunctional.git
from functional import seq seq((1, 2), (2, 3)).group_by(lambda e: e[0]).filter(lambda e: len(e[1]) > 0)
mypy says
Argument 1 to "len" has incompatible type "Sequence[LogEntry]"; expected "Sized"
Imo, type hint of .group_by() is wrong and should be like as
.group_by()
def group_by( self, func: Callable[[_T_co], _T] - ) -> Sequence[tuple[_T, Sequence[_T_co]]]: + ) -> Sequence[tuple[_T, list[_T_co]]]:
You can see the code of .group_by() method here. https://github.com/EntilZha/PyFunctional/blob/d1b64791da61954a48160eded823ccabb00f0566/functional/pipeline.py#L1075-L1077
But I'm not sure. Could anyone check this, please?
I tried this code
mypy says
Imo, type hint of
.group_by()
is wrong and should be like asYou can see the code of
.group_by()
method here. https://github.com/EntilZha/PyFunctional/blob/d1b64791da61954a48160eded823ccabb00f0566/functional/pipeline.py#L1075-L1077But I'm not sure. Could anyone check this, please?