Skip to content

Commit e0cc2fc

Browse files
ruancomellimiss-islington
authored andcommitted
Fix type annotation of pstats.FunctionProfile.ncalls (pythonGH-96741)
* fix: annotate `pstats.FunctionProfile.ncalls` as `str` This change aligns the type annotation of `pstats.FunctionProfile.ncalls` with its runtime type. (cherry picked from commit 8e9a37d) Co-authored-by: Ruan Comelli <[email protected]>
1 parent 7528e2c commit e0cc2fc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/pstats.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __new__(cls, *values):
5656

5757
@dataclass(unsafe_hash=True)
5858
class FunctionProfile:
59-
ncalls: int
59+
ncalls: str
6060
tottime: float
6161
percall_tottime: float
6262
cumtime: float
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Corrected type annotation for dataclass attribute ``pstats.FunctionProfile.ncalls`` to be ``str``.

0 commit comments

Comments
 (0)