summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-07-23 14:36:02 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-07-23 14:36:02 (GMT)
commitf1b5ccb9937b8336078f023bf7deb6615a5e28c8 (patch)
treeab6ec047bdb5921d3fbe251092ad9cb6cdfd8951 /Lib/inspect.py
parent28cff18dedaf994109a1c4c8f363a076941e1ba3 (diff)
downloadcpython-f1b5ccb9937b8336078f023bf7deb6615a5e28c8.zip
cpython-f1b5ccb9937b8336078f023bf7deb6615a5e28c8.tar.gz
cpython-f1b5ccb9937b8336078f023bf7deb6615a5e28c8.tar.bz2
Issue #13248: Remove inspect.getargspec from 3.6 (deprecated from 3.0)
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 24c8df7..4e78d80 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1002,31 +1002,6 @@ def _getfullargs(co):
varkw = co.co_varnames[nargs]
return args, varargs, kwonlyargs, varkw
-
-ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')
-
-def getargspec(func):
- """Get the names and default values of a function's arguments.
-
- A tuple of four things is returned: (args, varargs, keywords, defaults).
- 'args' is a list of the argument names, including keyword-only argument names.
- 'varargs' and 'keywords' are the names of the * and ** arguments or None.
- 'defaults' is an n-tuple of the default values of the last n arguments.
-
- Use the getfullargspec() API for Python 3 code, as annotations
- and keyword arguments are supported. getargspec() will raise ValueError
- if the func has either annotations or keyword arguments.
- """
- warnings.warn("inspect.getargspec() is deprecated, "
- "use inspect.signature() instead", DeprecationWarning,
- stacklevel=2)
- args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \
- getfullargspec(func)
- if kwonlyargs or ann:
- raise ValueError("Function has keyword-only arguments or annotations"
- ", use getfullargspec() API which can support them")
- return ArgSpec(args, varargs, varkw, defaults)
-
FullArgSpec = namedtuple('FullArgSpec',
'args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations')