get_type_hints()
should support functools.partial()
#3478
Labels
enhancement
it's not broken, but we want it to be better
Our
get_type_hints()
helper doesn't currently supportfunctools.partial()
, but I think it should - it's easy enough to detect, recurse on the wrapped callable, and then drop any bound-positional args (bound kwargs just assign a default value).We should also consider upstreaming this fix into
typing.get_type_hints()
, sinceinspect.signature()
does this already.The text was updated successfully, but these errors were encountered: