Skip to content

Commit dd73096

Browse files
committed
Upgrade MyPy to 1.16.0 and fix a few typing issues
Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
1 parent 537f460 commit dd73096

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

looptime/loops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def setup_looptime(
9696
def time(self) -> float:
9797
return self.__int2time(self.__now)
9898

99-
def run_in_executor(self, executor: Any, func: Any, *args: Any) -> AnyFuture:
99+
def run_in_executor(self, executor: Any, func: Any, *args: Any) -> AnyFuture: # type: ignore
100100
future = super().run_in_executor(executor, func, *args)
101101
if isinstance(future, asyncio.Future):
102102
self.__sync_futures.add(future)

looptime/math.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import abc
4+
from typing import Any
45

56

67
class Numeric(metaclass=abc.ABCMeta):
@@ -108,5 +109,6 @@ def __mod__(self, other: object) -> float:
108109
else:
109110
return NotImplemented
110111

111-
def __pow__(self, power: float, modulo: None = None) -> float:
112+
# See the StdLib's comments on pow() on why it is Any, not float.
113+
def __pow__(self, power: float, modulo: None = None) -> Any:
112114
return pow(round(self._value * self.__rr), power, modulo) / pow(self.__rr, power, modulo)

looptime/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from looptime import loops, patchers
99

1010

11-
@pytest.hookimpl(hookwrapper=True) # type: ignore
11+
@pytest.hookimpl(hookwrapper=True)
1212
def pytest_fixture_setup(fixturedef: Any, request: Any) -> Any:
1313
if fixturedef.argname == "event_loop":
1414
result = yield

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ codecov
66
coverage
77
coveralls
88
isort
9-
mypy==0.920
9+
mypy==1.16.0
1010
pre-commit
1111
pytest
1212
pytest-asyncio<1.0.0

0 commit comments

Comments
 (0)