Skip to content

Commit ea3da6c

Browse files
committed
🔨 refactor(convex_api/registry.py, tests/intergration/test_convex_multi_thread.py): remove unnecessary Tuple import and replace with tuple
🧹 chore(convex_api/registry.py, tests/intergration/test_convex_multi_thread.py): clean up imports for better readability and maintainability
1 parent 798787d commit ea3da6c

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

‎convex_api/registry.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import logging
77
from typing import (
88
TYPE_CHECKING,
9-
Tuple,
109
cast
1110
)
1211

@@ -27,7 +26,7 @@ class Registry:
2726
def __init__(self, convex: 'API'):
2827
self._convex = convex
2928
self._address = None
30-
self._items: dict[str, Tuple[int, int] | None] = {}
29+
self._items: dict[str, tuple[int, int] | None] = {}
3130

3231
def is_registered(self, name: str):
3332
return self.item(name) is not None
@@ -38,7 +37,7 @@ def item(self, name: str):
3837
logger.debug(f'cns-database: {result}')
3938
self._items[name] = None
4039
if isinstance(result.value, (list, tuple)):
41-
self._items[name] = cast(Tuple[int, int], result.value)
40+
self._items[name] = cast(tuple[int, int], result.value)
4241
return self._items[name]
4342

4443
def clear(self):
@@ -55,7 +54,7 @@ def register(self, name: str, contract_address: int, account: Account):
5554
if result and hasattr(result, 'value'):
5655
items = result.value
5756
if name in items:
58-
item: Tuple[int, int] = items[name]
57+
item: tuple[int, int] = items[name]
5958
self._items[name] = item
6059
return item
6160
except ConvexAPIError as e:

‎tests/intergration/test_convex_multi_thread.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
Process,
99
Value
1010
)
11-
from typing import (
12-
Any,
13-
)
11+
from typing import Any
1412

1513
import pytest # type: ignore # noqa: F401
1614

0 commit comments

Comments
 (0)