mirror of https://github.com/astral-sh/ruff
15 lines
315 B
Python
15 lines
315 B
Python
"""Test: referencing an import via TypeAlias (with future annotations and quotes)."""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
import numpy as np
|
|
|
|
if sys.version_info >= (3, 10):
|
|
from typing import TypeAlias
|
|
else:
|
|
from typing_extensions import TypeAlias
|
|
|
|
|
|
CustomInt: TypeAlias = "np.int8 | np.int16"
|