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
But mypy says this does not type-check. After adding a cast (normalize=cast(Any, identity), or even normalize=cast(Callable[[str], T], identity), this works fine.
The text was updated successfully, but these errors were encountered:
This is intentional, as the caller of f gets to choose T and identity does not have type Callable[[str], T] for most types T. Also see the discussion at #1721.
Have you simplified the type of your real function f? It's hard to see how you could use normalize with this signature for f anyways.
I'm trying to do something like this:
But mypy says this does not type-check. After adding a cast (
normalize=cast(Any, identity)
, or evennormalize=cast(Callable[[str], T], identity)
, this works fine.The text was updated successfully, but these errors were encountered: