dgilland / pydash

The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library.

Home Page:http://pydash.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typing: find_index only accepts Callable or None

mawaliya opened this issue · comments

commented

pydash = 7.0.4
python = 3.10.6

The old code of:

data = [{"a": 0, "b": 3},{"a": "1", "c": 5}]
a0 = find_index(data, {"a": 0})

When the type check is on, pylance will complain:

Argument of type "dict[str, str]" cannot be assigned to parameter "predicate" of type "None" in function "find_index"

Expected:
To add the type compatability.

commented

this should fix it

Fix has been released in v7.0.5: https://pypi.org/project/pydash/7.0.5/