File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
106107STRUCT_MAPPING = Settings (
107108 Integer8 = struct .Struct (b"<b" ),
You can’t perform that action at this time.
0 commit comments