From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 5 Oct 2022 21:57:11 +0000 (-0700) Subject: [3.11] Fix type annotation of `pstats.FunctionProfile.ncalls` (GH-96741) (#96835) X-Git-Tag: v3.11.1~353 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8d50aeada9b6e2be1a4b6e498002c11b783a32a;p=thirdparty%2FPython%2Fcpython.git [3.11] Fix type annotation of `pstats.FunctionProfile.ncalls` (GH-96741) (#96835) This change aligns the type annotation of `pstats.FunctionProfile.ncalls` with its runtime type. (cherry picked from commit 8e9a37dde44c9fa0b961cb2db5dc8266e1f85d11) Co-authored-by: Ruan Comelli --- diff --git a/Lib/pstats.py b/Lib/pstats.py index 8e0743f2e5f2..80408313e8b2 100644 --- a/Lib/pstats.py +++ b/Lib/pstats.py @@ -57,7 +57,7 @@ class SortKey: @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 000000000000..e7f53311e589 --- /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``.