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've found #2003, though that was closed a while back. I'm not totally clear why that was closed (from the comments I can't work out what the solution was, nor if agreement was reached on an approach). Additionally a lot has changed since then with regards to argument typing -- notably ParamSpec, TypeVarTuple & Unpack now exist, though I'm not sure if any of them actually help here as the wrapped function is static rather than also being part of the call signature.
Ideally I'd like to be able to do this in cases where the original function is annotated, though without needing to change that function's annotations (e.g: because it's in a library), so using e.g: Unpack[TypedDict] would require me to repeat the definitions of the original function's signature, which is partly what I'm trying to avoid by using passthrough *args, **kwargs in the first place.
Aside: is "inherit" the right term for this? I wasn't sure what to search for.
The text was updated successfully, but these errors were encountered:
It would be great if there were a way to inherit the (argument) type signatures from one function to another. The use case here is something like:
I've found #2003, though that was closed a while back. I'm not totally clear why that was closed (from the comments I can't work out what the solution was, nor if agreement was reached on an approach). Additionally a lot has changed since then with regards to argument typing -- notably
ParamSpec
,TypeVarTuple
&Unpack
now exist, though I'm not sure if any of them actually help here as the wrapped function is static rather than also being part of the call signature.Ideally I'd like to be able to do this in cases where the original function is annotated, though without needing to change that function's annotations (e.g: because it's in a library), so using e.g:
Unpack[TypedDict]
would require me to repeat the definitions of the original function's signature, which is partly what I'm trying to avoid by using passthrough*args
,**kwargs
in the first place.Aside: is "inherit" the right term for this? I wasn't sure what to search for.
The text was updated successfully, but these errors were encountered: