Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: fix
Signed-off-by: samsja <[email protected]>
  • Loading branch information
samsja committed Jan 26, 2023
commit da11139bb0bf6ea25e39a89a372cd5876b5f3cc1
3 changes: 1 addition & 2 deletions docarray/utils/_typing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import collections
from types import GenericAlias
from typing import Any, _AnnotatedAlias, _GenericAlias

from typing_inspect import is_union_type
Expand All @@ -20,7 +19,7 @@ def get_args(tp):
"""
if isinstance(tp, _AnnotatedAlias):
return (tp.__origin__,) + tp.__metadata__
if isinstance(tp, (_GenericAlias, GenericAlias)):
if isinstance(tp, _GenericAlias):
res = tp.__args__
if tp.__origin__ is collections.abc.Callable and res[0] is not Ellipsis:
res = (list(res[:-1]), res[-1])
Expand Down