@@ -142,6 +142,7 @@ pub struct PyContext {
142
142
pub type_type : PyObjectRef ,
143
143
pub zip_type : PyObjectRef ,
144
144
pub function_type : PyObjectRef ,
145
+ pub builtin_function_or_method_type : PyObjectRef ,
145
146
pub property_type : PyObjectRef ,
146
147
pub module_type : PyObjectRef ,
147
148
pub bound_method_type : PyObjectRef ,
@@ -193,6 +194,12 @@ impl PyContext {
193
194
let classmethod_type = create_type ( "classmethod" , & type_type, & object_type, & dict_type) ;
194
195
let staticmethod_type = create_type ( "staticmethod" , & type_type, & object_type, & dict_type) ;
195
196
let function_type = create_type ( "function" , & type_type, & object_type, & dict_type) ;
197
+ let builtin_function_or_method_type = create_type (
198
+ "builtin_function_or_method" ,
199
+ & type_type,
200
+ & object_type,
201
+ & dict_type,
202
+ ) ;
196
203
let property_type = create_type ( "property" , & type_type, & object_type, & dict_type) ;
197
204
let super_type = create_type ( "super" , & type_type, & object_type, & dict_type) ;
198
205
let generator_type = create_type ( "generator" , & type_type, & object_type, & dict_type) ;
@@ -273,6 +280,7 @@ impl PyContext {
273
280
slice_type,
274
281
object : object_type,
275
282
function_type,
283
+ builtin_function_or_method_type,
276
284
super_type,
277
285
property_type,
278
286
generator_type,
@@ -410,6 +418,10 @@ impl PyContext {
410
418
self . function_type . clone ( )
411
419
}
412
420
421
+ pub fn builtin_function_or_method_type ( & self ) -> PyObjectRef {
422
+ self . builtin_function_or_method_type . clone ( )
423
+ }
424
+
413
425
pub fn property_type ( & self ) -> PyObjectRef {
414
426
self . property_type . clone ( )
415
427
}
@@ -546,7 +558,7 @@ impl PyContext {
546
558
PyObjectPayload :: RustFunction {
547
559
function : Box :: new ( function) ,
548
560
} ,
549
- self . function_type ( ) ,
561
+ self . builtin_function_or_method_type ( ) ,
550
562
)
551
563
}
552
564
@@ -556,7 +568,7 @@ impl PyContext {
556
568
) -> PyObjectRef {
557
569
PyObject :: new (
558
570
PyObjectPayload :: RustFunction { function } ,
559
- self . function_type ( ) ,
571
+ self . builtin_function_or_method_type ( ) ,
560
572
)
561
573
}
562
574
0 commit comments