Skip to content

Commit dfbaeb4

Browse files
committed
#157 Update type variables
1 parent 63f78c5 commit dfbaeb4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

xarray_dataclasses/typing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555

5656
# type hints (private)
5757
PInit = ParamSpec("PInit")
58-
TAttr = TypeVar("TAttr")
58+
T = TypeVar("T")
5959
TDataClass = TypeVar("TDataClass", bound="DataClass[Any]")
6060
TDims = TypeVar("TDims", covariant=True)
6161
TDType = TypeVar("TDType", covariant=True)
62-
TName = TypeVar("TName", bound=Hashable)
62+
THashable = TypeVar("THashable", bound=Hashable)
6363

6464
AnyArray: TypeAlias = "np.ndarray[Any, Any]"
6565
AnyDType: TypeAlias = "np.dtype[Any]"
@@ -114,7 +114,7 @@ def annotates(cls, tp: Any) -> bool:
114114
return any(isinstance(arg, cls) for arg in get_args(tp))
115115

116116

117-
Attr = Annotated[TAttr, FType.ATTR]
117+
Attr = Annotated[T, FType.ATTR]
118118
"""Type hint to define attribute fields (``Attr[TAttr]``).
119119
120120
Example:
@@ -236,7 +236,7 @@ class ColorImage(AsDataset):
236236
237237
"""
238238

239-
Name = Annotated[TName, FType.NAME]
239+
Name = Annotated[THashable, FType.NAME]
240240
"""Type hint to define name fields (``Name[TName]``).
241241
242242
Example:

0 commit comments

Comments
 (0)