mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue 24248: Deprecate inspect.Signature.from_function and .from_builtin
This commit is contained in:
parent
45d6156154
commit
57c74fca02
4 changed files with 16 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue