Skip to content

Commit 1eadf1a

Browse files
authored
Use int | Any for types.FrameType.f_lineno (#6935)
1 parent 01f3f8a commit 1eadf1a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/types.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,10 @@ class FrameType:
346346
f_code: CodeType
347347
f_globals: dict[str, Any]
348348
f_lasti: int
349-
f_lineno: int | None
349+
# see discussion in #6769: f_lineno *can* sometimes be None,
350+
# but you should probably file a bug report with CPython if you encounter it being None in the wild.
351+
# An `int | None` annotation here causes too many false-positive errors.
352+
f_lineno: int | Any
350353
f_locals: dict[str, Any]
351354
f_trace: Callable[[FrameType, str, Any], Any] | None
352355
if sys.version_info >= (3, 7):

0 commit comments

Comments
 (0)