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 larry
Recipients benjamin.peterson, eric.araujo, larry, ncoghlan, pitrou, python-dev, scoder, terry.reedy, yselivanov
Date 2014-02-03.10:44:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391424247.14.0.921716315844.issue17159@psf.upfronthosting.co.za>
In-reply-to
Content
Yyou have just answered the question "How do you determine signature information for functions written in Python?".  A shorter way to express this answer: functions written in Python are implemented as a "function object" (in C, PyFunctionObject), which internally has a reference to a "code object" (PyCodeObject).  These two objects collectively contain all the information you'd need to determine the function's signature in Python.

However, builtin functions don't use either of these objects.  Builtin functions are implemented with a "builtin code object" (PyCFunctionObject) which doesn't have any of the metadata you cited.  So that doesn't answer my question.  Nor is it practical to implement a builtin function using a "function object" and a "code object".

So I'll ask you again:

> Be specific.  Let's say we remove __text_signature__.  How do we
> now write a C extension in a way that we can have introspection
> information for its callables?
History
Date User Action Args
2014-02-03 10:44:07larrysetrecipients: + larry, terry.reedy, ncoghlan, pitrou, scoder, benjamin.peterson, eric.araujo, python-dev, yselivanov
2014-02-03 10:44:07larrysetmessageid: <1391424247.14.0.921716315844.issue17159@psf.upfronthosting.co.za>
2014-02-03 10:44:07larrylinkissue17159 messages
2014-02-03 10:44:07larrycreate