Skip to content

Commit

Permalink
generate FixedTuple member from annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuDartiailh committed Mar 21, 2024
1 parent 7e506b0 commit 89e83ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions atom/meta/annotation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from ..scalars import Bool, Bytes, Callable as ACallable, Float, Int, Str, Value
from ..set import Set as ASet
from ..subclass import Subclass
from ..tuple import Tuple as ATuple
from ..tuple import FixedTuple, Tuple as ATuple
from ..typed import Typed
from ..typing_utils import extract_types, get_args, is_optional
from .member_modifiers import set_default
Expand Down Expand Up @@ -71,10 +71,10 @@ def generate_member_from_type_or_generic(
):
# We can only validate homogeneous tuple so far so we ignore other cases
if t is tuple:
if (...) in parameters or len(set(parameters)) == 1:
if (...) in parameters:
parameters = (parameters[0],)
else:
parameters = ()
m_cls = FixedTuple
parameters = tuple(
generate_member_from_type_or_generic(
t, _NO_DEFAULT, annotate_type_containers - 1
Expand Down

0 comments on commit 89e83ee

Please sign in to comment.