8000 Extend type forwarding to other context managers (#903) · draftcode/client_python@c48e26e · GitHub
[go: up one dir, main page]

Skip to content

Commit c48e26e

Browse files
authored
Extend type forwarding to other context managers (prometheus#903)
Signed-off-by: Crutcher Dunnavant <crutcher@openai.com>
1 parent 30f8319 commit c48e26e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prometheus_client/context_managers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __enter__(self):
4646
def __exit__(self, typ, value, traceback):
4747
self._gauge.dec()
4848

49-
def __call__(self, f):
49+
def __call__(self, f: "F") -> "F":
5050
def wrapped(func, *args, **kwargs):
5151
with self:
5252
return func(*args, **kwargs)
@@ -75,7 +75,7 @@ def __exit__(self, typ, value, traceback):
7575
def labels(self, *args, **kw):
7676
self._metric = self._metric.labels(*args, **kw)
7777

78-
def __call__(self, f):
78+
def __call__(self, f: "F") -> "F":
7979
def wrapped(func, *args, **kwargs):
8080
# Obtaining new instance of timer every time
8181
# ensures thread safety and reentrancy.

0 commit comments

Comments
 (0)
0