Issue 24248: Deprecate inspect.Signature.from_function and .from_builtin

This commit is contained in:
Yury Selivanov 2015-05-20 23:07:02 -04:00
parent 45d6156154
commit 57c74fca02
4 changed files with 16 additions and 12 deletions

View file

@ -2661,11 +2661,17 @@ class Signature:
@classmethod
def from_function(cls, func):
"""Constructs Signature for the given python function."""
warnings.warn("inspect.Signature.from_function() is deprecated, "
"use Signature.from_callable()", DeprecationWarning)
return _signature_from_function(cls, func)
@classmethod
def from_builtin(cls, func):
"""Constructs Signature for the given builtin function."""
warnings.warn("inspect.Signature.from_builtin() is deprecated, "
"use Signature.from_callable()", DeprecationWarning)
return _signature_from_builtin(cls, func)
@classmethod