Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Don't create TypeVars at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Jul 9, 2024
1 parent c5b36f5 commit bf64a1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
13 changes: 6 additions & 7 deletions nitro_generator_checker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@
from aiohttp import ClientSession, DummyCookieJar, TCPConnector
from rich.console import Console
from rich.logging import RichHandler
from typing_extensions import TypeVar

from . import http
from .nitro_checker import NitroChecker
from .utils import bytes_decode

if TYPE_CHECKING:
from typing import Callable, Coroutine

from typing_extensions import Any

if sys.version_info >= (3, 11):
try:
import tomllib
Expand All @@ -31,7 +25,12 @@
else:
import tomli as tomllib

T = TypeVar("T")
if TYPE_CHECKING:
from typing import Callable, Coroutine

from typing_extensions import Any, TypeVar

T = TypeVar("T")


def get_async_run() -> Callable[[Coroutine[Any, Any, T]], T]:
Expand Down
7 changes: 3 additions & 4 deletions nitro_generator_checker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
from typing import TYPE_CHECKING

import charset_normalizer
from typing_extensions import ParamSpec, TypeVar

if TYPE_CHECKING:
from typing import Callable, Coroutine

from typing_extensions import Any
from typing_extensions import Any, ParamSpec, TypeVar

T = TypeVar("T")
P = ParamSpec("P")
T = TypeVar("T")
P = ParamSpec("P")


background_tasks: set[asyncio.Task[Any]] = set()
Expand Down

0 comments on commit bf64a1d

Please sign in to comment.