Skip to content

Commit 1b3c87e

Browse files
committed
Add type annotations for RuntimeTimer
1 parent edb8391 commit 1b3c87e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bpython/repl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@
6363
class RuntimeTimer:
6464
"""Calculate running time"""
6565

66-
def __init__(self):
66+
def __init__(self) -> None:
6767
self.reset_timer()
6868
self.time = time.monotonic if hasattr(time, "monotonic") else time.time
6969

70-
def __enter__(self):
70+
def __enter__(self) -> None:
7171
self.start = self.time()
7272

7373
def __exit__(
@@ -80,11 +80,11 @@ def __exit__(
8080
self.running_time += self.last_command
8181
return False
8282

83-
def reset_timer(self):
83+
def reset_timer(self) -> None:
8484
self.running_time = 0.0
8585
self.last_command = 0.0
8686

87-
def estimate(self):
87+
def estimate(self) -> float:
8888
return self.running_time - self.last_command
8989

9090

0 commit comments

Comments
 (0)