]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix type annotation of `pstats.FunctionProfile.ncalls` (#96741)
authorRuan Comelli <ruancomelli@gmail.com>
Thu, 15 Sep 2022 01:33:43 +0000 (22:33 -0300)
committerGitHub <noreply@github.com>
Thu, 15 Sep 2022 01:33:43 +0000 (18:33 -0700)
* fix: annotate `pstats.FunctionProfile.ncalls` as `str`

This change aligns the type annotation of `pstats.FunctionProfile.ncalls` with its runtime type.

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 8e0743f2e5f29df18f9005d5bb16a8362bd50163..80408313e8b27fccab728126e5b0aa4d7e2d24cf 100644 (file)
@@ -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 (file)
index 0000000..e7f5331
--- /dev/null
@@ -0,0 +1 @@
+Corrected type annotation for dataclass attribute ``pstats.FunctionProfile.ncalls`` to be ``str``.