From 1cb615c37e49c63879fbcd24fb75a8c4115031ea Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sat, 5 Aug 2023 21:39:44 -0500 Subject: [PATCH 1/3] Add missing type annotations to `_core/_mock_clock.py` --- trio/_core/_mock_clock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trio/_core/_mock_clock.py b/trio/_core/_mock_clock.py index fe35298631..06a6292b73 100644 --- a/trio/_core/_mock_clock.py +++ b/trio/_core/_mock_clock.py @@ -62,7 +62,7 @@ class MockClock(Clock, metaclass=Final): """ - def __init__(self, rate: float = 0.0, autojump_threshold: float = inf): + def __init__(self, rate: float = 0.0, autojump_threshold: float = inf) -> None: # when the real clock said 'real_base', the virtual time was # 'virtual_base', and since then it's advanced at 'rate' virtual # seconds per real second. @@ -150,7 +150,7 @@ def deadline_to_sleep_time(self, deadline: float) -> float: else: return 999999999 - def jump(self, seconds) -> None: + def jump(self, seconds: float) -> None: """Manually advance the clock by the given number of seconds. Args: From 13097fa58100fc4113aa88f0abe5ea7f696b3182 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sun, 6 Aug 2023 01:06:28 -0500 Subject: [PATCH 2/3] Update `verify_types.json` --- trio/_tests/verify_types.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/trio/_tests/verify_types.json b/trio/_tests/verify_types.json index ac2cfbd197..d9ea85cf4e 100644 --- a/trio/_tests/verify_types.json +++ b/trio/_tests/verify_types.json @@ -7,11 +7,11 @@ "warningCount": 0 }, "typeCompleteness": { - "completenessScore": 0.9154704944178629, + "completenessScore": 0.9170653907496013, "exportedSymbolCounts": { "withAmbiguousType": 0, - "withKnownType": 574, - "withUnknownType": 53 + "withKnownType": 575, + "withUnknownType": 52 }, "ignoreUnknownTypesFromImports": true, "missingClassDocStringCount": 1, @@ -46,12 +46,11 @@ ], "otherSymbolCounts": { "withAmbiguousType": 3, - "withKnownType": 600, - "withUnknownType": 63 + "withKnownType": 602, + "withUnknownType": 61 }, "packageName": "trio", "symbols": [ - "trio._core._mock_clock.MockClock.jump", "trio._core._run.Nursery.start", "trio._core._run.Nursery.start_soon", "trio._core._run.TaskStatus.__repr__", From 4516897f26163d544d1023417aad0c10a02a9d4b Mon Sep 17 00:00:00 2001 From: jakkdl Date: Sun, 6 Aug 2023 12:01:56 +0200 Subject: [PATCH 3/3] remove -> None on __init__ until decision taken to enforce it globally --- trio/_core/_mock_clock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trio/_core/_mock_clock.py b/trio/_core/_mock_clock.py index 06a6292b73..27a5829076 100644 --- a/trio/_core/_mock_clock.py +++ b/trio/_core/_mock_clock.py @@ -62,7 +62,7 @@ class MockClock(Clock, metaclass=Final): """ - def __init__(self, rate: float = 0.0, autojump_threshold: float = inf) -> None: + def __init__(self, rate: float = 0.0, autojump_threshold: float = inf): # when the real clock said 'real_base', the virtual time was # 'virtual_base', and since then it's advanced at 'rate' virtual # seconds per real second.