8000 [3.12] gh-115937: Remove implementation details from inspect.signatur… · python/cpython@31462d4 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 31462d4

Browse files
miss-islingtonerlend-aaslandwillingcgpsheadJelleZijlstra
authored
[3.12] gh-115937: Remove implementation details from inspect.signature() docs (GH-116086) (#116106)
gh-115937: Remove implementation details from inspect.signature() docs (GH-116086) (cherry picked from commit fb2e17b) Co-authored-by: Erlend E. Aasland <erlend@python.org> 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 542f327 commit 31462d4

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
@@ -655,9 +655,6 @@ function.
655655
Accepts a wide range of Python callables, from plain functions and classes to
656656
:func:`functools.partial` objects.
657657

658-
If the passed object has a ``__signature__`` attribute, this function
659-
returns it without further computations.
660-
661658
For objects defined in modules using stringized annotations
662659
(``from __future__ import annotations``), :func:`signature` will
663660
attempt to automatically un-stringize the annotations using
@@ -692,6 +689,13 @@ function.
692689
Python. For example, in CPython, some built-in functions defined in
693690
C provide no metadata about their arguments.
694691

692+
.. impl-detail::
693+
694+
If the passed object has a :attr:`!__signature__` attribute,
695+
we may use it to create the signature.
696+
The exact semantics are an implementation detail and are subject to
697+
unannounced changes. Consult the source code for current semantics.
698+
695699

696700
.. class:: Signature(parameters=None, *, return_annotation=Signature.empty)
697701

0 commit comments

Comments
 (0)
0