]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] Fix type annotation of `pstats.FunctionProfile.ncalls` (GH-96741) (#96836)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 5 Oct 2022 21:57:26 +0000 (14:57 -0700)
committerGitHub <noreply@github.com>
Wed, 5 Oct 2022 21:57:26 +0000 (14:57 -0700)
This change aligns the type annotation of `pstats.FunctionProfile.ncalls` with its runtime type.
(cherry picked from commit 8e9a37dde44c9fa0b961cb2db5dc8266e1f85d11)

Co-authored-by: Ruan Comelli <ruancomelli@gmail.com>
Lib/pstats.py
Misc/NEWS.d/next/Library/2022-09-15-00-37-33.gh-issue-96741.4b6czN.rst [new file with mode: 0644]

index 0f93ae02c95074dfd6bddff780474d11c28a654c..ac88c04dee25af39dd0b47208b571313b055dd81 100644 (file)
@@ -56,7 +56,7 @@ class SortKey(str, Enum):
 
 @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 (file)
index 0000000..e7f5331
--- /dev/null
@@ -0,0 +1 @@
+Corrected type annotation for dataclass attribute ``pstats.FunctionProfile.ncalls`` to be ``str``.