What what i would really like is #1506
however mapping types is pretty complex and general.
Consider something like Dask's client.submit
submit[T, **P](self, func: Callable[P, T], *args: P.args, **kwargs: P.kwargs) -> Future[T]
What it actually wants is any type in the outer arguments can be
either the original type Q, in P.args or P.kwargs, or Future[Q].
But specifying that is a bit fiddly.
A less complex thing would be to introduce a special form AnyLike
which can be run as
submit[T, **P](self, func: Callable[P, T], *args: AnyLike[P].args, **kwargs: AnyLike[P].kwargs) -> Future[T]
which would have the effect of allowing the types in
args to be Any but the number must match that in the paramspec P,
and similar the types in kwargs can be Any but the names must till match those in the paramspec P
What what i would really like is #1506
however mapping types is pretty complex and general.
Consider something like Dask's
client.submitsubmit[T, **P](self, func: Callable[P, T], *args: P.args, **kwargs: P.kwargs) -> Future[T]What it actually wants is any type in the outer arguments can be
either the original type
Q, inP.argsorP.kwargs, orFuture[Q].But specifying that is a bit fiddly.
A less complex thing would be to introduce a special form
AnyLikewhich can be run as
submit[T, **P](self, func: Callable[P, T], *args: AnyLike[P].args, **kwargs: AnyLike[P].kwargs) -> Future[T]which would have the effect of allowing the types in
argsto beAnybut the number must match that in the paramspecP,and similar the types in
kwargscan beAnybut the names must till match those in the paramspecP