Skip to content

Commit

Permalink
pythongh-115937: Remove implementation details from inspect.signature…
Browse files Browse the repository at this point in the history
…() docs (pythonGH-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]>
  • Loading branch information
4 people authored and miss-islington committed Feb 29, 2024
1 parent 542f327 commit ac3fa69
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Doc/library/inspect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,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
Expand Down Expand Up @@ -692,6 +689,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)

Expand Down

0 comments on commit ac3fa69

Please sign in to comment.