Skip to content

Commit d89815f

Browse files
committed
Merge branch 'master' into bugfix/394303-dates
2 parents 2fbb1eb + 0bc5d67 commit d89815f

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

wolframclient/language/array.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def _valid_type_or_fail(self, type):
3737
def tobytes(self):
3838
return pack(self.struct.format[1], *self.array)
3939

40+
4041
def __getitem__(self, k):
4142
return self.array[k]
4243

@@ -49,6 +50,6 @@ def _valid_type_or_fail(self, type):
4950
if type not in constants.VALID_PACKED_ARRAY_LABEL_TYPES:
5051
raise WolframLanguageException(
5152
"Type %s is not one of the supported packed array types: %s."
52-
% (type, ", ".join(constants.VALID_PACKED_ARRAY_LABEL_TYPES_TUPLE))
53+
% (type, ", ".join(sorted(constants.VALID_PACKED_ARRAY_LABEL_TYPES)))
5354
)
5455
return type

wolframclient/serializers/wxfencoder/constants.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,18 @@ def _bytes(value):
9191
)
9292
)
9393

94-
VALID_PACKED_ARRAY_LABEL_TYPES_TUPLE = (
95-
"Integer8",
96-
"Integer16",
97-
"Integer32",
98-
"Integer64",
99-
"Real32",
100-
"Real64",
101-
"ComplexReal32",
102-
"ComplexReal64",
94+
VALID_PACKED_ARRAY_LABEL_TYPES = frozenset(
95+
(
96+
"Integer8",
97+
"Integer16",
98+
"Integer32",
99+
"Integer64",
100+
"Real32",
101+
"Real64",
102+
"ComplexReal32",
103+
"ComplexReal64",
104+
)
103105
)
104-
VALID_PACKED_ARRAY_LABEL_TYPES = frozenset(VALID_PACKED_ARRAY_LABEL_TYPES_TUPLE)
105106

106107
STRUCT_MAPPING = Settings(
107108
Integer8=struct.Struct(b"<b"),

0 commit comments

Comments
 (0)