Message210109
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? |
|
Date |
User |
Action |
Args |
2014-02-03 10:44:07 | larry | set | recipients:
+ larry, terry.reedy, ncoghlan, pitrou, scoder, benjamin.peterson, eric.araujo, python-dev, yselivanov |
2014-02-03 10:44:07 | larry | set | messageid: <1391424247.14.0.921716315844.issue17159@psf.upfronthosting.co.za> |
2014-02-03 10:44:07 | larry | link | issue17159 messages |
2014-02-03 10:44:07 | larry | create | |
|