summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorMatthias Bussonnier <bussonniermatthias@gmail.com>2018-10-19 23:40:45 (GMT)
committerVictor Stinner <vstinner@redhat.com>2018-10-19 23:40:45 (GMT)
commitded87d804e2a85b2a3ea9e7a11384b41fafdfa29 (patch)
tree3695c896b456710543dadb95ce11adeb18d2e193 /Lib/inspect.py
parent0f14fc1a7cb2ea0012d0a943e4460acdee2108d7 (diff)
downloadcpython-ded87d804e2a85b2a3ea9e7a11384b41fafdfa29.zip
cpython-ded87d804e2a85b2a3ea9e7a11384b41fafdfa29.tar.gz
cpython-ded87d804e2a85b2a3ea9e7a11384b41fafdfa29.tar.bz2
bpo-33594: Add deprecation info in inspect.py module (GH-7036)
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 857892b..3edf97d 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1070,8 +1070,10 @@ def getargspec(func):
Alternatively, use getfullargspec() for an API with a similar namedtuple
based interface, but full support for annotations and keyword-only
parameters.
+
+ Deprecated since Python 3.5, use `inspect.getfullargspec()`.
"""
- warnings.warn("inspect.getargspec() is deprecated, "
+ warnings.warn("inspect.getargspec() is deprecated since Python 3.0, "
"use inspect.signature() or inspect.getfullargspec()",
DeprecationWarning, stacklevel=2)
args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \
@@ -2797,19 +2799,25 @@ class Signature:
@classmethod
def from_function(cls, func):
- """Constructs Signature for the given python function."""
+ """Constructs Signature for the given python function.
+
+ Deprecated since Python 3.5, use `Signature.from_callable()`.
+ """
- warnings.warn("inspect.Signature.from_function() is deprecated, "
- "use Signature.from_callable()",
+ warnings.warn("inspect.Signature.from_function() is deprecated since "
+ "Python 3.5, use Signature.from_callable()",
DeprecationWarning, stacklevel=2)
return _signature_from_function(cls, func)
@classmethod
def from_builtin(cls, func):
- """Constructs Signature for the given builtin function."""
+ """Constructs Signature for the given builtin function.
+
+ Deprecated since Python 3.5, use `Signature.from_callable()`.
+ """
- warnings.warn("inspect.Signature.from_builtin() is deprecated, "
- "use Signature.from_callable()",
+ warnings.warn("inspect.Signature.from_builtin() is deprecated since "
+ "Python 3.5, use Signature.from_callable()",
DeprecationWarning, stacklevel=2)
return _signature_from_builtin(cls, func)