Skip to content

Commit 0a6a62f

Browse files
committed
fixed union type creations
1 parent 6983002 commit 0a6a62f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fileformats/core/fileset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import inspect
55
import itertools
66
import logging
7+
import operator
78
import os
89
import shutil
910
import struct
@@ -707,8 +708,8 @@ def add_concrete(datatype: ty.Type[DataType]) -> None:
707708
for datatype in datatypes:
708709
add_concrete(datatype)
709710
# TODO: Might want to sort datatypes in a more specific order
710-
return ty.Union.__getitem__( # pyright: ignore[reportAttributeAccessIssue]
711-
tuple(sorted(concrete_datatypes, key=union_sort_key))
711+
return functools.reduce(
712+
operator.or_, sorted(concrete_datatypes, key=union_sort_key)
712713
) # type: ignore[return-value]
713714

714715
@classmethod

0 commit comments

Comments
 (0)