|
1 | 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst |
2 | 2 |
|
3 | | -from __future__ import annotations |
4 | | - |
5 | 3 | import warnings |
6 | 4 | from collections.abc import Iterable |
7 | | -from typing import TYPE_CHECKING, ClassVar, Literal |
| 5 | +from typing import ClassVar, Literal |
8 | 6 |
|
9 | 7 | import numpy as np |
10 | 8 |
|
11 | | -from astropy.units.core import CompositeUnit, NamedUnit, Unit, get_current_unit_registry |
| 9 | +from astropy.extern.ply.lex import LexToken |
| 10 | +from astropy.units.core import ( |
| 11 | + CompositeUnit, |
| 12 | + NamedUnit, |
| 13 | + Unit, |
| 14 | + UnitBase, |
| 15 | + get_current_unit_registry, |
| 16 | +) |
12 | 17 | from astropy.units.errors import UnitsWarning |
| 18 | +from astropy.units.typing import UnitPower, UnitScale |
13 | 19 | from astropy.units.utils import maybe_simple_fraction |
14 | 20 | from astropy.utils.misc import did_you_mean |
15 | 21 |
|
16 | | -if TYPE_CHECKING: |
17 | | - from astropy.extern.ply.lex import LexToken |
18 | | - from astropy.units import UnitBase |
19 | | - from astropy.units.typing import UnitPower, UnitScale |
20 | | - |
21 | 22 |
|
22 | 23 | class Base: |
23 | 24 | """ |
24 | 25 | The abstract base class of all unit formats. |
25 | 26 | """ |
26 | 27 |
|
27 | | - registry: ClassVar[dict[str, type[Base]]] = {} |
| 28 | + registry: ClassVar[dict[str, type["Base"]]] = {} |
28 | 29 | _space: ClassVar[str] = " " |
29 | 30 | _scale_unit_separator: ClassVar[str] = " " |
30 | 31 | _times: ClassVar[str] = "*" |
|
0 commit comments