We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8807c19 commit d734dd8Copy full SHA for d734dd8
etils/edc/cast_utils.py
@@ -17,31 +17,17 @@
17
from __future__ import annotations
18
19
import dataclasses
20
-import typing
21
-from typing import Any, TypeVar
+from typing import Any
22
23
from etils.edc import field_utils
24
from etils.edc import helpers
25
from typing_extensions import Annotated
26
27
28
-_T = TypeVar('_T')
29
-
30
_IS_NORMALIZED = object()
31
32
33
-if typing.TYPE_CHECKING:
34
- # TODO(b/254514368): Remove hack
35
- class _AutoCastMeta(type):
36
37
- def __getitem__(cls, value):
38
- return value
39
40
- class AutoCast(metaclass=_AutoCastMeta):
41
- pass
42
43
-else:
44
- AutoCast = Annotated[_T, _IS_NORMALIZED] # pytype: disable=invalid-typevar
+type AutoCast[T] = Annotated[T, _IS_NORMALIZED]
45
46
47
def make_auto_cast_descriptor(
0 commit comments