@@ -130,6 +130,7 @@ pub struct PyContext {
130
130
pub map_type : PyObjectRef ,
131
131
pub memoryview_type : PyObjectRef ,
132
132
pub none : PyObjectRef ,
133
+ pub ellipsis : PyObjectRef ,
133
134
pub not_implemented : PyObjectRef ,
134
135
pub tuple_type : PyObjectRef ,
135
136
pub set_type : PyObjectRef ,
@@ -223,6 +224,12 @@ impl PyContext {
223
224
create_type ( "NoneType" , & type_type, & object_type, & dict_type) ,
224
225
) ;
225
226
227
+ // TODO: implement proper ellipsis class?
228
+ let ellipsis = PyObject :: new (
229
+ PyObjectPayload :: None ,
230
+ create_type ( "EllipsisType" , & type_type, & object_type, & dict_type) ,
231
+ ) ;
232
+
226
233
let not_implemented = PyObject :: new (
227
234
PyObjectPayload :: NotImplemented ,
228
235
create_type ( "NotImplementedType" , & type_type, & object_type, & dict_type) ,
@@ -263,6 +270,7 @@ impl PyContext {
263
270
zip_type,
264
271
dict_type,
265
272
none,
273
+ ellipsis,
266
274
not_implemented,
267
275
str_type,
268
276
range_type,
@@ -441,6 +449,11 @@ impl PyContext {
441
449
pub fn none ( & self ) -> PyObjectRef {
442
450
self . none . clone ( )
443
451
}
452
+
453
+ pub fn ellipsis ( & self ) -> PyObjectRef {
454
+ self . ellipsis . clone ( )
455
+ }
456
+
444
457
pub fn not_implemented ( & self ) -> PyObjectRef {
445
458
self . not_implemented . clone ( )
446
459
}
@@ -699,6 +712,7 @@ impl PyContext {
699
712
self . new_tuple ( elements)
700
713
}
701
714
bytecode:: Constant :: None => self . none ( ) ,
715
+ bytecode:: Constant :: Ellipsis => self . ellipsis ( ) ,
702
716
}
703
717
}
704
718
}
0 commit comments