Skip to content

Commit d734dd8

Browse files
QwlouseThe etils Authors
authored andcommitted
remove obsolete AutoCast pytype workaround
PiperOrigin-RevId: 788877579
1 parent 8807c19 commit d734dd8

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

etils/edc/cast_utils.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,17 @@
1717
from __future__ import annotations
1818

1919
import dataclasses
20-
import typing
21-
from typing import Any, TypeVar
20+
from typing import Any
2221

2322
from etils.edc import field_utils
2423
from etils.edc import helpers
2524
from typing_extensions import Annotated
2625

2726

28-
_T = TypeVar('_T')
29-
3027
_IS_NORMALIZED = object()
3128

3229

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
30+
type AutoCast[T] = Annotated[T, _IS_NORMALIZED]
4531

4632

4733
def make_auto_cast_descriptor(

0 commit comments

Comments
 (0)