projektAI/venv/Lib/site-packages/numpy/typing/_shape.py

16 lines
441 B
Python
Raw Normal View History

2021-06-06 22:13:05 +02:00
import sys
from typing import Sequence, Tuple, Union, TYPE_CHECKING
if TYPE_CHECKING:
if sys.version_info >= (3, 8):
from typing import SupportsIndex
else:
from typing_extensions import Protocol
class SupportsIndex(Protocol):
def __index__(self) -> int: ...
_Shape = Tuple[int, ...]
# Anything that can be coerced to a shape tuple
_ShapeLike = Union["SupportsIndex", Sequence["SupportsIndex"]]