2023-12-27 16:57:20 +03:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2023-12-27 16:54:48 +03:00
|
|
|
import sys
|
2024-02-05 23:49:43 +03:00
|
|
|
from typing import Sequence, Union
|
2023-12-27 16:54:48 +03:00
|
|
|
|
|
|
|
if sys.version_info >= (3, 10):
|
|
|
|
from typing import TypeGuard
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
from typing_extensions import TypeGuard
|
|
|
|
except ImportError:
|
2023-12-27 16:57:20 +03:00
|
|
|
from typing import Any
|
2023-12-27 16:54:48 +03:00
|
|
|
|
|
|
|
class TypeGuard: # type: ignore[no-redef]
|
2023-12-27 16:57:20 +03:00
|
|
|
def __class_getitem__(cls, item: Any) -> type[bool]:
|
2023-12-27 16:54:48 +03:00
|
|
|
return bool
|
|
|
|
|
|
|
|
|
2024-02-05 23:49:43 +03:00
|
|
|
Coords = Union[Sequence[float], Sequence[Sequence[float]]]
|
|
|
|
|
|
|
|
|
2023-12-27 16:54:48 +03:00
|
|
|
__all__ = ["TypeGuard"]
|