Skip to content

Commit 04a88d5

Browse files
pstats.FunctionProfile.ncalls should be str (#8712)
Correctly annotate `pstats.FunctionProfile.ncalls` as `str` instead of `int`. Since this change introduces a difference between typeshed and CPython, add a comment pointing that out and linking to this PR. Co-authored-by: Alex Waygood <[email protected]>
1 parent ab02255 commit 04a88d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/pstats.pyi

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ if sys.version_info >= (3, 9):
3030

3131
@dataclass(unsafe_hash=True)
3232
class FunctionProfile:
33-
ncalls: int
33+
# Note: the annotation in the CPython codebase is "int", but the annotation in CPython is wrong! See #8712
34+
ncalls: str
3435
tottime: float
3536
percall_tottime: float
3637
cumtime: float

0 commit comments

Comments
 (0)