summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend@python.org>2024-02-29 09:42:28 (GMT)
committerGitHub <noreply@github.com>2024-02-29 09:42:28 (GMT)
commitfb2e17b642fc3089e4f98e4bf6b09dd362e6b27d (patch)
tree11144903ff7efeb9328f4c4f105a274d0392d906 /Doc
parent86e5e063aba76a7f4fc58f7d06b17b0a4730fd8e (diff)
downloadcpython-fb2e17b642fc3089e4f98e4bf6b09dd362e6b27d.zip
cpython-fb2e17b642fc3089e4f98e4bf6b09dd362e6b27d.tar.gz
cpython-fb2e17b642fc3089e4f98e4bf6b09dd362e6b27d.tar.bz2
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>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/inspect.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 8a74cad..ed8d705 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -665,9 +665,6 @@ function.
Accepts a wide range of Python callables, from plain functions and classes to
: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
(``from __future__ import annotations``), :func:`signature` will
attempt to automatically un-stringize the annotations using
@@ -702,6 +699,13 @@ function.
Python. For example, in CPython, some built-in functions defined in
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)