Skip to content

Commit fb2e17b

Browse files
erlend-aaslandwillingcgpsheadJelleZijlstra
authored
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>
1 parent 86e5e06 commit fb2e17b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Doc/library/inspect.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,6 @@ function.
665665
Accepts a wide range of Python callables, from plain functions and classes to
666666
:func:`functools.partial` objects.
667667

668-
If the passed object has a ``__signature__`` attribute, this function
669-
returns it without further computations.
670-
671668
For objects defined in modules using stringized annotations
672669
(``from __future__ import annotations``), :func:`signature` will
673670
attempt to automatically un-stringize the annotations using
@@ -702,6 +699,13 @@ function.
702699
Python. For example, in CPython, some built-in functions defined in
703700
C provide no metadata about their arguments.
704701

702+
.. impl-detail::
703+
704+
If the passed object has a :attr:`!__signature__` attribute,
705+
we may use it to create the signature.
706+
The exact semantics are an implementation detail and are subject to
707+
unannounced changes. Consult the source code for current semantics.
708+
705709

706710
.. class:: Signature(parameters=None, *, return_annotation=Signature.empty)
707711

0 commit comments

Comments
 (0)