@@ -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 = \
@@ -2802,19 +2804,25 @@ def __init__(self, parameters=None, *, return_annotation=_empty,
28022804
28032805 @classmethod
28042806 def from_function (cls , func ):
2805- """Constructs Signature for the given python function."""
2807+ """Constructs Signature for the given python function.
2808+
2809+ Deprecated since Python 3.5, use `Signature.from_callable()`.
2810+ """
28062811
2807- warnings .warn ("inspect.Signature.from_function() is deprecated, "
2808- "use Signature.from_callable()" ,
2812+ warnings .warn ("inspect.Signature.from_function() is deprecated since "
2813+ "Python 3.5, use Signature.from_callable()" ,
28092814 DeprecationWarning , stacklevel = 2 )
28102815 return _signature_from_function (cls , func )
28112816
28122817 @classmethod
28132818 def from_builtin (cls , func ):
2814- """Constructs Signature for the given builtin function."""
2819+ """Constructs Signature for the given builtin function.
2820+
2821+ Deprecated since Python 3.5, use `Signature.from_callable()`.
2822+ """
28152823
2816- warnings .warn ("inspect.Signature.from_builtin() is deprecated, "
2817- "use Signature.from_callable()" ,
2824+ warnings .warn ("inspect.Signature.from_builtin() is deprecated since "
2825+ "Python 3.5, use Signature.from_callable()" ,
28182826 DeprecationWarning , stacklevel = 2 )
28192827 return _signature_from_builtin (cls , func )
28202828
0 commit comments