You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think bool as return type of the callable makes no sense here.
Running the code works perfectly fine, just the checker complaining.
Expected Output
By looking into the source Callable[[Any], Any] would work (because the result is passed to str()), or a more defined one like Callable[[Any], int | str | bytes] as these are common returns of hash functions.
The text was updated successfully, but these errors were encountered:
Thanks for filing the issue, @axtimhaus! I will have a look soon. I am wondering whether we need the flexibility with the union return type. Maybe I find packages offering similar functionality for inspiration.
main
branch of pytask.Code Sample, a copy-pastable example
This is the example from the docs https://pytask-dev.readthedocs.io/en/stable/how_to_guides/hashing_inputs_of_tasks.html.
Problem description
When I do this example, my type checker complains about the type of the provided hash function.
Type annotation from current master:
pytask/src/_pytask/nodes.py
Line 238 in f18df8f
I think
bool
as return type of the callable makes no sense here.Running the code works perfectly fine, just the checker complaining.
Expected Output
By looking into the source
Callable[[Any], Any]
would work (because the result is passed tostr()
), or a more defined one likeCallable[[Any], int | str | bytes]
as these are common returns of hash functions.The text was updated successfully, but these errors were encountered: