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 ncoghlan
Recipients brett.cannon, larry, ncoghlan, yselivanov
Date 2014-01-29.12:36:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390999004.53.0.0851041836763.issue20422@psf.upfronthosting.co.za>
In-reply-to
Content
This proposal and patch look good to me. The current behaviour definitely isn't desirable:

>>> import inspect
>>> inspect.Signature.from_function(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ncoghlan/devel/py3k/Lib/inspect.py", line 1888, in from_function
    raise TypeError('{!r} is not a Python function'.format(func))
TypeError: 1 is not a Python function
>>> inspect.Signature.from_builtin(1)
>>> 

Signature.from_function() and Signature.from_builtin() should both also be documented, but we may want to wait for PEP 457 and #17373 in Python 3.5 before sorting all that out.
History
Date User Action Args
2014-01-29 12:36:44ncoghlansetrecipients: + ncoghlan, brett.cannon, larry, yselivanov
2014-01-29 12:36:44ncoghlansetmessageid: <1390999004.53.0.0851041836763.issue20422@psf.upfronthosting.co.za>
2014-01-29 12:36:44ncoghlanlinkissue20422 messages
2014-01-29 12:36:44ncoghlancreate