mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
(cherry picked from commit 8a387219bd
)
Co-authored-by: Yury Selivanov <yury@magic.io>
This commit is contained in:
parent
5a0c3987ab
commit
112f799666
3 changed files with 13 additions and 1 deletions
|
@ -2254,7 +2254,8 @@ def _signature_from_callable(obj, *,
|
|||
return sig
|
||||
else:
|
||||
sig_params = tuple(sig.parameters.values())
|
||||
assert first_wrapped_param is not sig_params[0]
|
||||
assert (not sig_params or
|
||||
first_wrapped_param is not sig_params[0])
|
||||
new_params = (first_wrapped_param,) + sig_params
|
||||
return sig.replace(parameters=new_params)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue