Message51458
For getargs and getargvalues, including the names in positional args is an excellent strategy.
There are uses (in cgitb) in the stdlib for getargvalues that then wouldn't need to be changed.
The 2 uses of getargspec in the stdlib (one of which I missed, in DocXMLRPCServer) are both
closely followed by formatargspec. I think those APIs should change or information will be lost.
Alternatively, a new function (hopefully with a better name than getfullargspec :) could be
made and getargspec could retain its API, but raise an error when keyword-only arguments are
present.
def getargspec(func):
args, varargs, kwonlyargs, kwdefaults, varkw, defaults, ann = getfullargspec()
if kwonlyargs:
raise ValueError, "function has keyword-only arguments, use getfullargspec!"
return args, varargs, varkw, defaults
I'll update the patch to fix getargvalues and DocXMLRPCServer this weekend. |
|
Date |
User |
Action |
Args |
2007-08-23 15:55:34 | admin | link | issue1607548 messages |
2007-08-23 15:55:34 | admin | create | |
|