From 8e9a37dde44c9fa0b961cb2db5dc8266e1f85d11 Mon Sep 17 00:00:00 2001 From: Ruan Comelli Date: Wed, 14 Sep 2022 22:33:43 -0300 Subject: [PATCH] Fix type annotation of `pstats.FunctionProfile.ncalls` (#96741) * fix: annotate `pstats.FunctionProfile.ncalls` as `str` This change aligns the type annotation of `pstats.FunctionProfile.ncalls` with its runtime type. --- Lib/pstats.py | 2 +- .../next/Library/2022-09-15-00-37-33.gh-issue-96741.4b6czN.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2022-09-15-00-37-33.gh-issue-96741.4b6czN.rst diff --git a/Lib/pstats.py b/Lib/pstats.py index 8e0743f2e5f..80408313e8b 100644 --- a/Lib/pstats.py +++ b/Lib/pstats.py @@ -57,7 +57,7 @@ def __new__(cls, *values): @dataclass(unsafe_hash=True) class FunctionProfile: - ncalls: int + ncalls: str tottime: float percall_tottime: float cumtime: float diff --git a/Misc/NEWS.d/next/Library/2022-09-15-00-37-33.gh-issue-96741.4b6czN.rst b/Misc/NEWS.d/next/Library/2022-09-15-00-37-33.gh-issue-96741.4b6czN.rst new file mode 100644 index 00000000000..e7f53311e58 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-09-15-00-37-33.gh-issue-96741.4b6czN.rst @@ -0,0 +1 @@ +Corrected type annotation for dataclass attribute ``pstats.FunctionProfile.ncalls`` to be ``str``.