@@ -51,6 +51,7 @@ use crate::obj::objstr;
5151use crate :: obj:: objsuper;
5252use crate :: obj:: objtuple:: { self , PyTuple , PyTupleRef } ;
5353use crate :: obj:: objtype:: { self , PyClass , PyClassRef } ;
54+ use crate :: obj:: objweakproxy;
5455use crate :: obj:: objweakref;
5556use crate :: obj:: objzip;
5657use crate :: vm:: VirtualMachine ;
@@ -158,6 +159,7 @@ pub struct PyContext {
158159 pub module_type : PyClassRef ,
159160 pub bound_method_type : PyClassRef ,
160161 pub weakref_type : PyClassRef ,
162+ pub weakproxy_type : PyClassRef ,
161163 pub object : PyClassRef ,
162164 pub exceptions : exceptions:: ExceptionZoo ,
163165}
@@ -255,6 +257,7 @@ impl PyContext {
255257 let readonly_property_type = create_type ( "readonly_property" , & type_type, & object_type) ;
256258 let super_type = create_type ( "super" , & type_type, & object_type) ;
257259 let weakref_type = create_type ( "ref" , & type_type, & object_type) ;
260+ let weakproxy_type = create_type ( "weakproxy" , & type_type, & object_type) ;
258261 let generator_type = create_type ( "generator" , & type_type, & object_type) ;
259262 let bound_method_type = create_type ( "method" , & type_type, & object_type) ;
260263 let str_type = create_type ( "str" , & type_type, & object_type) ;
@@ -361,6 +364,7 @@ impl PyContext {
361364 module_type,
362365 bound_method_type,
363366 weakref_type,
367+ weakproxy_type,
364368 type_type,
365369 exceptions,
366370 } ;
@@ -396,6 +400,7 @@ impl PyContext {
396400 objcode:: init ( & context) ;
397401 objframe:: init ( & context) ;
398402 objweakref:: init ( & context) ;
403+ objweakproxy:: init ( & context) ;
399404 objnone:: init ( & context) ;
400405 objmodule:: init ( & context) ;
401406 exceptions:: init ( & context) ;
@@ -554,6 +559,10 @@ impl PyContext {
554559 self . weakref_type . clone ( )
555560 }
556561
562+ pub fn weakproxy_type ( & self ) -> PyClassRef {
563+ self . weakproxy_type . clone ( )
564+ }
565+
557566 pub fn type_type ( & self ) -> PyClassRef {
558567 self . type_type . clone ( )
559568 }
0 commit comments