Author serhiy.storchaka
Recipients ncoghlan, rhettinger, serhiy.storchaka, yselivanov
Date 2017-04-23.20:18:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492978705.31.0.200843668782.issue30149@psf.upfronthosting.co.za>
In-reply-to
Content
>>> 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'
History
Date User Action Args
2017-04-23 20:18:25serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, ncoghlan, yselivanov
2017-04-23 20:18:25serhiy.storchakasetmessageid: <1492978705.31.0.200843668782.issue30149@psf.upfronthosting.co.za>
2017-04-23 20:18:25serhiy.storchakalinkissue30149 messages
2017-04-23 20:18:25serhiy.storchakacreate