Skip to content

Commit

Permalink
Typeshed cherry-pick: Use int | Any for types.FrameType.f_lineno (#…
Browse files Browse the repository at this point in the history
…6935) (#12240)

This fixes some regressions.
  • Loading branch information
JukkaL authored Feb 22, 2022
1 parent bb1fda3 commit eca4c30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mypy/typeshed/stdlib/types.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ class FrameType:
f_code: CodeType
f_globals: dict[str, Any]
f_lasti: int
f_lineno: int | None
# see discussion in #6769: f_lineno *can* sometimes be None,
# but you should probably file a bug report with CPython if you encounter it being None in the wild.
# An `int | None` annotation here causes too many false-positive errors.
f_lineno: int | Any
f_locals: dict[str, Any]
f_trace: Callable[[FrameType, str, Any], Any] | None
if sys.version_info >= (3, 7):
Expand Down

0 comments on commit eca4c30

Please sign in to comment.