@@ -51,6 +51,7 @@ use crate::obj::objstr;
51
51
use crate :: obj:: objsuper;
52
52
use crate :: obj:: objtuple:: { self , PyTuple , PyTupleRef } ;
53
53
use crate :: obj:: objtype:: { self , PyClass , PyClassRef } ;
54
+ use crate :: obj:: objweakproxy;
54
55
use crate :: obj:: objweakref;
55
56
use crate :: obj:: objzip;
56
57
use crate :: vm:: VirtualMachine ;
@@ -158,6 +159,7 @@ pub struct PyContext {
158
159
pub module_type : PyClassRef ,
159
160
pub bound_method_type : PyClassRef ,
160
161
pub weakref_type : PyClassRef ,
162
+ pub weakproxy_type : PyClassRef ,
161
163
pub object : PyClassRef ,
162
164
pub exceptions : exceptions:: ExceptionZoo ,
163
165
}
@@ -255,6 +257,7 @@ impl PyContext {
255
257
let readonly_property_type = create_type ( "readonly_property" , & type_type, & object_type) ;
256
258
let super_type = create_type ( "super" , & type_type, & object_type) ;
257
259
let weakref_type = create_type ( "ref" , & type_type, & object_type) ;
260
+ let weakproxy_type = create_type ( "weakproxy" , & type_type, & object_type) ;
258
261
let generator_type = create_type ( "generator" , & type_type, & object_type) ;
259
262
let bound_method_type = create_type ( "method" , & type_type, & object_type) ;
260
263
let str_type = create_type ( "str" , & type_type, & object_type) ;
@@ -361,6 +364,7 @@ impl PyContext {
361
364
module_type,
362
365
bound_method_type,
363
366
weakref_type,
367
+ weakproxy_type,
364
368
type_type,
365
369
exceptions,
366
370
} ;
@@ -396,6 +400,7 @@ impl PyContext {
396
400
objcode:: init ( & context) ;
397
401
objframe:: init ( & context) ;
398
402
objweakref:: init ( & context) ;
403
+ objweakproxy:: init ( & context) ;
399
404
objnone:: init ( & context) ;
400
405
objmodule:: init ( & context) ;
401
406
exceptions:: init ( & context) ;
@@ -554,6 +559,10 @@ impl PyContext {
554
559
self . weakref_type . clone ( )
555
560
}
556
561
562
+ pub fn weakproxy_type ( & self ) -> PyClassRef {
563
+ self . weakproxy_type . clone ( )
564
+ }
565
+
557
566
pub fn type_type ( & self ) -> PyClassRef {
558
567
self . type_type . clone ( )
559
568
}
0 commit comments