On Tue, Feb 11, 2014 at 12:13 PM, Travis Griggs <travisgriggs at gmail.com> wrote:
> So here?s my basic question. Is there anyway to programatically query that information in python code?
> just gives a ValueError. inspect must only be good for the python code that I write, in python. Is there another way to dig out what the interpreter knows there?
Fixing that issue is in the works. Argument Clinic has been
added for Python 3.4 which, once all C functions have been converted,
will provide signature information for all builtins (functions written
in C). If you try out the Python 3.4 RC1, you can try
inspect.signature(datetime.datetime.now) again and get the information
you expect: that's one of the (unfortunately relatively few) builtins
that is already converted.
Aside from the Argument Clinic effort, builtin functions are pretty
much black boxes to Python--hence why we're trying to fix it!