[Python-Dev] Updated PEP 362 (Function Signature Object)
Terry Reedy
tjreedy at udel.edu
Thu Jun 7 01:02:15 CEST 2012
On 6/6/2012 6:38 PM, Steven D'Aprano wrote:
> redundant. Even so, getfullargspec is not doing any harm. We're not
> *adding* complexity, it's already there, and breaking currently working
> code by deprecating and then removing it is not a step we should take
> lightly. API churn is itself a cost.
The 3.x versions of idlelib.CallTips.get_argspec() uses
inspect.formatargspec(*inspect.getfullargspec(fob))
to create the first line of a calltip for Python coded callables
(functions and (bound) instance methods, including class(.__init__),
static and class methods and (with pending patch) instance(.__call__)).
Any new class would have to have a identical formatter to replace this.
I do not quite see the point of deprecating these functions. It seems to
that a new presentation object should build on top of the existing
getfullargspec, when it is requested.
I agree with Stephen that building the seldom-needed redundant
representation upon creation of every function object is a bad idea.
--
Terry Jan Reedy
More information about the Python-Dev
mailing list