8000 gh-106310 - document the __signature__ attribute (GH-106311) · miss-islington/cpython@cd678d6 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd678d6

Browse files
GouvernathorAlexWaygood
authored andcommitted
pythongh-106310 - document the __signature__ attribute (pythonGH-106311)
Document the __signature__ attribute (cherry picked from commit b07f232) Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent 9addf2c commit cd678d6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/library/inspect.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,9 @@ function.
619619
Accepts a wide range of Python callables, from plain functions and classes to
620620
:func:`functools.partial` objects.
621621

622+
If the passed object has a ``__signature__`` attribute, this function
623+
returns it without further computations.
624+
622625
For objects defined in modules using stringized annotations
623626
(``from __future__ import annotations``), :func:`signature` will
624627
attempt to automatically un-stringize the annotations using
@@ -738,6 +741,8 @@ function.
738741
sig = MySignature.from_callable(min)
739742
assert isinstance(sig, MySignature)
740743

744+
Its behavior is otherwise identical to that of :func:`signature`.
745+
741746
.. versionadded:: 3.5
742747

743748
.. versionadded:: 3.10

0 commit comments

Comments
 (0)
0