Skip to content

Commit 40858cb

Browse files
committed
fix: format for black
Signed-off-by: 954 <[email protected]>
1 parent 3a85e67 commit 40858cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docarray/array/any_array.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
from docarray.proto import DocListProto, NodeProto
3131
from docarray.typing.tensor.abstract_tensor import AbstractTensor
3232

33+
if sys.version_info < (3, 12):
34+
from types import GenericAlias
35+
3336
T = TypeVar('T', bound='AnyDocArray')
3437
T_doc = TypeVar('T_doc', bound=BaseDocWithoutId)
3538
IndexIterType = Union[slice, Iterable[int], Iterable[bool], None]
@@ -57,7 +60,6 @@ def __class_getitem__(cls, item: Union[Type[BaseDocWithoutId], TypeVar, str]):
5760
# this do nothing that checking that item is valid type var or str
5861
# Keep the approach in #1147 to be compatible with lower versions of Python.
5962
else:
60-
from types import GenericAlias
6163
return GenericAlias(cls, item) # type: ignore
6264
if not safe_issubclass(item, BaseDocWithoutId):
6365
raise ValueError(

0 commit comments

Comments
 (0)