Message292184
>>> import functools, inspect
>>> class A:
... f = functools.partialmethod((lambda self, x, y, *args: ...), 1)
...
>>> inspect.signature(A.f)
<Signature (self, y, *args)>
>>> class A:
... f = functools.partialmethod((lambda *args: ...), 1)
...
>>> inspect.signature(A.f)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/serhiy/py/cpython/Lib/inspect.py", line 3007, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
File "/home/serhiy/py/cpython/Lib/inspect.py", line 2757, in from_callable
follow_wrapper_chains=follow_wrapped)
File "/home/serhiy/py/cpython/Lib/inspect.py", line 2227, in _signature_from_callable
return sig.replace(parameters=new_params)
File "/home/serhiy/py/cpython/Lib/inspect.py", line 2780, in replace
return_annotation=return_annotation)
File "/home/serhiy/py/cpython/Lib/inspect.py", line 2725, in __init__
raise ValueError(msg)
ValueError: duplicate parameter name: 'args' |
|
Date |
User |
Action |
Args |
2017-04-23 20:18:25 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, ncoghlan, yselivanov |
2017-04-23 20:18:25 | serhiy.storchaka | set | messageid: <1492978705.31.0.200843668782.issue30149@psf.upfronthosting.co.za> |
2017-04-23 20:18:25 | serhiy.storchaka | link | issue30149 messages |
2017-04-23 20:18:25 | serhiy.storchaka | create | |
|