@@ -1070,8 +1070,10 @@ def getargspec(func):
10701070 Alternatively, use getfullargspec() for an API with a similar namedtuple
10711071 based interface, but full support for annotations and keyword-only
10721072 parameters.
1073+
1074+ Deprecated since Python 3.5, use `inspect.getfullargspec()`.
10731075 """
1074- warnings .warn ("inspect.getargspec() is deprecated, "
1076+ warnings .warn ("inspect.getargspec() is deprecated since Python 3.0 , "
10751077 "use inspect.signature() or inspect.getfullargspec()" ,
10761078 DeprecationWarning , stacklevel = 2 )
10771079 args , varargs , varkw , defaults , kwonlyargs , kwonlydefaults , ann = \
@@ -2784,19 +2786,25 @@ def __init__(self, parameters=None, *, return_annotation=_empty,
27842786
27852787 @classmethod
27862788 def from_function (cls , func ):
2787- """Constructs Signature for the given python function."""
2789+ """Constructs Signature for the given python function.
2790+
2791+ Deprecated since Python 3.5, use `Signature.from_callable()`.
2792+ """
27882793
2789- warnings .warn ("inspect.Signature.from_function() is deprecated, "
2790- "use Signature.from_callable()" ,
2794+ warnings .warn ("inspect.Signature.from_function() is deprecated since "
2795+ "Python 3.5, use Signature.from_callable()" ,
27912796 DeprecationWarning , stacklevel = 2 )
27922797 return _signature_from_function (cls , func )
27932798
27942799 @classmethod
27952800 def from_builtin (cls , func ):
2796- """Constructs Signature for the given builtin function."""
2801+ """Constructs Signature for the given builtin function.
2802+
2803+ Deprecated since Python 3.5, use `Signature.from_callable()`.
2804+ """
27972805
2798- warnings .warn ("inspect.Signature.from_builtin() is deprecated, "
2799- "use Signature.from_callable()" ,
2806+ warnings .warn ("inspect.Signature.from_builtin() is deprecated since "
2807+ "Python 3.5, use Signature.from_callable()" ,
28002808 DeprecationWarning , stacklevel = 2 )
28012809 return _signature_from_builtin (cls , func )
28022810
0 commit comments