From 04a88d57405be17fa508f1242680df9ac0ddcf97 Mon Sep 17 00:00:00 2001 From: Ruan Comelli Date: Sat, 10 Sep 2022 17:11:45 -0300 Subject: [PATCH] `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 --- stdlib/pstats.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/pstats.pyi b/stdlib/pstats.pyi index 7629cd634..3876fff5e 100644 --- a/stdlib/pstats.pyi +++ b/stdlib/pstats.pyi @@ -30,7 +30,8 @@ if sys.version_info >= (3, 9): @dataclass(unsafe_hash=True) class FunctionProfile: - ncalls: int + # Note: the annotation in the CPython codebase is "int", but the annotation in CPython is wrong! See #8712 + ncalls: str tottime: float percall_tottime: float cumtime: float