Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-108901: Add inspect.Signature.from_frame #116537

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve docs
sobolevn committed Mar 9, 2024
commit b434fbc759569d8f24f330eef2d6e0bf7ed45dd0
6 changes: 6 additions & 0 deletions Doc/library/inspect.rst
Original file line number Diff line number Diff line change
@@ -822,6 +822,12 @@ function.
Return a :class:`Signature` (or its subclass) object for a given
:ref:`frame object <frame-objects>`.

Notice that it is impossible to get signatures
with annotations from frames.
Because annotations are stored in functions.
Also note that default parameter values might
be modified inside the frame.
sobolevn marked this conversation as resolved.
Show resolved Hide resolved

.. versionadded:: 3.13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. versionadded:: 3.13
.. versionadded:: next



6 changes: 6 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
@@ -361,6 +361,12 @@ and only logged in :ref:`Python Development Mode <devmode>` or on :ref:`Python
built on debug mode <debug-build>`.
(Contributed by Victor Stinner in :gh:`62948`.)

inspect
-------

* Add :meth:`inspect.Signature.from_frame` to get signatures from frame objects
and to replace the old :func:`inspect.getargvalues` API.

ipaddress
---------