@@ -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 = \
@@ -2797,19 +2799,25 @@ def __init__(self, parameters=None, *, return_annotation=_empty,
27972799
27982800 @classmethod
27992801 def from_function (cls , func ):
2800- """Constructs Signature for the given python function."""
2802+ """Constructs Signature for the given python function.
2803+
2804+ Deprecated since Python 3.5, use `Signature.from_callable()`.
2805+ """
28012806
2802- warnings .warn ("inspect.Signature.from_function() is deprecated, "
2803- "use Signature.from_callable()" ,
2807+ warnings .warn ("inspect.Signature.from_function() is deprecated since "
2808+ "Python 3.5, use Signature.from_callable()" ,
28042809 DeprecationWarning , stacklevel = 2 )
28052810 return _signature_from_function (cls , func )
28062811
28072812 @classmethod
28082813 def from_builtin (cls , func ):
2809- """Constructs Signature for the given builtin function."""
2814+ """Constructs Signature for the given builtin function.
2815+
2816+ Deprecated since Python 3.5, use `Signature.from_callable()`.
2817+ """
28102818
2811- warnings .warn ("inspect.Signature.from_builtin() is deprecated, "
2812- "use Signature.from_callable()" ,
2819+ warnings .warn ("inspect.Signature.from_builtin() is deprecated since "
2820+ "Python 3.5, use Signature.from_callable()" ,
28132821 DeprecationWarning , stacklevel = 2 )
28142822 return _signature_from_builtin (cls , func )
28152823
0 commit comments