cpython: 621e98bfc74b (original) (raw)

Mercurial > cpython

changeset 96213:621e98bfc74b

Issue 20438: Add a note about deprecating old inspect APIs to whatsnew. Also, deprecate formatargspec, formatargvalues, and getargvalues functions. Since we are deprecating 'getfullargspec' function in 3.5 (documentation only, no DeprecationWarning), it makes sense to also deprecate functions designed to be directly used with it. In 3.6 we will remove 'getargsspec' function (was deprecated since Python 3.0), and start raising DeprecationWarnings in other 'getarg*' family of functions. We can remove them in 3.7 or later. Also, it is worth noting, that Signature API does not provide 100% of functionality that deprecated APIs have. It is important to do a soft deprecation of outdated APIs in 3.5 to gather users feedback, and improve Signature object.

Yury Selivanov yselivanov@sprymix.com
date Fri, 22 May 2015 16:28:05 -0400
parents 666e5b554f32
children 254b8e68959e
files Doc/library/inspect.rst Doc/whatsnew/3.5.rst
diffstat 2 files changed, 29 insertions(+), 2 deletions(-)[+] [-] Doc/library/inspect.rst 21 Doc/whatsnew/3.5.rst 10

line wrap: on

line diff

--- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -793,8 +793,10 @@ Classes and functions n elements listed in args. .. deprecated:: 3.0

.. function:: getfullargspec(func) @@ -834,6 +836,11 @@ Classes and functions are the names of the * and ** arguments or None. locals is the locals dictionary of the given frame.

+ .. function:: formatargspec(args[, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations[, formatarg, formatvarargs, formatvarkw, formatvalue, formatreturns, formatannotations]]) @@ -856,6 +863,11 @@ Classes and functions >>> formatargspec(*getfullargspec(f)) '(a: int, b: float)'

+ .. function:: formatargvalues(args[, varargs, varkw, locals, formatarg, formatvarargs, formatvarkw, formatvalue]) @@ -863,6 +875,11 @@ Classes and functions :func:getargvalues. The format* arguments are the corresponding optional formatting functions that are called to turn names and values into strings.

+ .. function:: getmro(cls)

--- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -815,6 +815,16 @@ Deprecated Python modules, functions and :meth:inspect.Signature.from_callable instead. (Contributed by Yury Selivanov in :issue:24248.) +* :func:inspect.getargspec is deprecated and scheduled to be removed in