mirror of https://github.com/python/cpython.git
gh-115937: Remove implementation details from inspect.signature() docs (#116086)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
86e5e063ab
commit
fb2e17b642
|
@ -665,9 +665,6 @@ function.
|
||||||
Accepts a wide range of Python callables, from plain functions and classes to
|
Accepts a wide range of Python callables, from plain functions and classes to
|
||||||
:func:`functools.partial` objects.
|
:func:`functools.partial` objects.
|
||||||
|
|
||||||
If the passed object has a ``__signature__`` attribute, this function
|
|
||||||
returns it without further computations.
|
|
||||||
|
|
||||||
For objects defined in modules using stringized annotations
|
For objects defined in modules using stringized annotations
|
||||||
(``from __future__ import annotations``), :func:`signature` will
|
(``from __future__ import annotations``), :func:`signature` will
|
||||||
attempt to automatically un-stringize the annotations using
|
attempt to automatically un-stringize the annotations using
|
||||||
|
@ -702,6 +699,13 @@ function.
|
||||||
Python. For example, in CPython, some built-in functions defined in
|
Python. For example, in CPython, some built-in functions defined in
|
||||||
C provide no metadata about their arguments.
|
C provide no metadata about their arguments.
|
||||||
|
|
||||||
|
.. impl-detail::
|
||||||
|
|
||||||
|
If the passed object has a :attr:`!__signature__` attribute,
|
||||||
|
we may use it to create the signature.
|
||||||
|
The exact semantics are an implementation detail and are subject to
|
||||||
|
unannounced changes. Consult the source code for current semantics.
|
||||||
|
|
||||||
|
|
||||||
.. class:: Signature(parameters=None, *, return_annotation=Signature.empty)
|
.. class:: Signature(parameters=None, *, return_annotation=Signature.empty)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue