Skip to content

Commit

Permalink
fix typing import for python<3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Aug 23, 2023
1 parent dbcc090 commit 06a38f8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions ahk/extensions.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
from __future__ import annotations

import asyncio
import sys
import warnings
from dataclasses import dataclass
from typing import Any
from typing import Callable
from typing import ParamSpec
from typing import TypeVar

if sys.version_info < (3, 10):
from typing_extensions import ParamSpec
else:
from typing import ParamSpec

from .directives import Include


Expand All @@ -17,6 +22,10 @@ class _ExtensionEntry:
method: Callable[..., Any]


T = TypeVar('T')
P = ParamSpec('P')


@dataclass
class _ExtensionMethodRegistry:
sync_methods: dict[str, _ExtensionEntry]
Expand Down Expand Up @@ -65,10 +74,6 @@ def merge(self, other: _ExtensionMethodRegistry) -> None:
_extension_method_registry = _ExtensionMethodRegistry(sync_methods={}, async_methods={})


T = TypeVar('T')
P = ParamSpec('P')


class Extension:
def __init__(
self,
Expand Down

0 comments on commit 06a38f8

Please sign in to comment.