[Python-ideas] built-in argspec for function objects (original) (raw)

Terry Reedy tjreedy at udel.edu
Sun Jan 27 02:51:39 CET 2013


On 1/26/2013 6:27 PM, nbv4 wrote:

def myfunction(a, b=c): pass

>>> myfunction.args ['a'] >>> myfunction.kwargs {'b': c} >>> myfunction.allargs ['a', 'b'] What do you all think? Argspec is kind of unwieldy, this I think looks a lot nicer.

The argument specifications are attributes of code objects. The inspect functions, including the new signature function, are one way to pull them out. You can write you own if you wish. I do not think they should be duplicated on function objects.

-- Terry Jan Reedy



More information about the Python-ideas mailing list