Skip to content
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
  • Loading branch information
sobolevn committed Mar 9, 2024
commit bbe3229db2176077f8ac964249e78edd93ff48b9
10 changes: 9 additions & 1 deletion Lib/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3108,7 +3108,15 @@ def from_callable(cls, obj, *,

@classmethod
def from_frame(cls, frame):
"""Constructs Signature from a given frame object."""
"""
Constructs Signature from a given frame object.

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.
"""
if not isframe(frame):
raise TypeError(f'Frame object expected, got: {type(frame)}')

Expand Down