diff -r 4ab2d8fac52b Lib/inspect.py --- a/Lib/inspect.py Tue Apr 15 12:01:57 2014 -0400 +++ b/Lib/inspect.py Tue Apr 15 15:27:36 2014 -0400 @@ -929,7 +929,7 @@ getfullargspec(func) if kwonlyargs or ann: raise ValueError("Function has keyword-only arguments or annotations" - ", use getfullargspec() API which can support them") + ", use inspect.signature() API which can support them") return ArgSpec(args, varargs, varkw, defaults) FullArgSpec = namedtuple('FullArgSpec', @@ -948,8 +948,12 @@ 'annotations' is a dictionary mapping argument names to annotations. The first four items in the tuple correspond to getargspec(). + + .. deprecated:: 3.5 + Use inspect.signature() instead of inspect.getfullargspec(). """ - + warnings.warn("Use inspect.signature() instead of inspect.getfullargspec()", + DeprecationWarning) try: # Re: `skip_bound_arg=False` # diff -r 4ab2d8fac52b Lib/test/test_inspect.py --- a/Lib/test/test_inspect.py Tue Apr 15 12:01:57 2014 -0400 +++ b/Lib/test/test_inspect.py Tue Apr 15 15:27:36 2014 -0400 @@ -580,6 +580,15 @@ kwonlyargs_e=['arg'], formatted='(*, arg)') + with self.assertWarns(DeprecationWarning): + inspect.getfullargspec(self.assertWarns) + + getfullargspec = getattr(inspect, 'getfullargspec', None) + if getfullargspec and sys.version_info >= (3, 7): + self.fail("inspect.getfullargspec() is deprecated since 3.5, " + "you must to remove it in 3.7") + + def test_argspec_api_ignores_wrapped(self): # Issue 20684: low level introspection API must ignore __wrapped__ @functools.wraps(mod.spam)