Skip to content

Commit 6e32837

Browse files
miss-islingtonerlend-aaslandwillingcgpsheadJelleZijlstra
authored
[3.11] gh-115937: Remove implementation details from inspect.signature() docs (GH-116086) (#116107)
gh-115937: Remove implementation details from inspect.signature() docs (GH-116086) (cherry picked from commit fb2e17b) Co-authored-by: Erlend E. Aasland <[email protected]> Co-authored-by: Carol Willing <[email protected]> Co-authored-by: Gregory P. Smith <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent e7dc853 commit 6e32837

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Doc/library/inspect.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,6 @@ function.
634634
Accepts a wide range of Python callables, from plain functions and classes to
635635
:func:`functools.partial` objects.
636636

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

671+
.. impl-detail::
672+
673+
If the passed object has a :attr:`!__signature__` attribute,
674+
we may use it to create the signature.
675+
The exact semantics are an implementation detail and are subject to
676+
unannounced changes. Consult the source code for current semantics.
677+
674678

675679
.. class:: Signature(parameters=None, *, return_annotation=Signature.empty)
676680

0 commit comments

Comments
 (0)