This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author louielu
Recipients larry, louielu, ncoghlan, python-dev, terry.reedy, yselivanov
Date 2017-04-30.17:11:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493572293.31.0.175007854103.issue20401@psf.upfronthosting.co.za>
In-reply-to
Content
Is there any reason that the second case Terry provide still will failed with ValueError?

class C:
    def meth2(**kwds): pass


ip.signature(C().meth2)

Traceback (most recent call last):
  File "/home/linux/Python/cpython/Lib/idlelib/idle_test/test_calltips.py", line 139, in test_starred_parameter
    self.assertEqual(signature(meth), mtip)
  File "/home/linux/Python/cpython/Lib/idlelib/calltips.py", line 149, in get_argspec
    argspec = str(inspect.signature(fob))
  File "/home/linux/Python/cpython/Lib/inspect.py", line 3028, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "/home/linux/Python/cpython/Lib/inspect.py", line 2778, in from_callable
    follow_wrapper_chains=follow_wrapped)
  File "/home/linux/Python/cpython/Lib/inspect.py", line 2195, in _signature_from_callable
    return _signature_bound_method(sig)
  File "/home/linux/Python/cpython/Lib/inspect.py", line 1785, in _signature_bound_method
    raise ValueError('invalid method signature')
ValueError: invalid method signature
History
Date User Action Args
2017-04-30 17:11:33louielusetrecipients: + louielu, terry.reedy, ncoghlan, larry, python-dev, yselivanov
2017-04-30 17:11:33louielusetmessageid: <1493572293.31.0.175007854103.issue20401@psf.upfronthosting.co.za>
2017-04-30 17:11:33louielulinkissue20401 messages
2017-04-30 17:11:33louielucreate