@@ -198,9 +198,9 @@ fn builtin_eval(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
198
198
) ;
199
199
200
200
// Determine code object:
201
- let code_obj = if objtype:: real_isinstance ( source, & vm. ctx . code_type ( ) ) {
201
+ let code_obj = if objtype:: isinstance ( source, & vm. ctx . code_type ( ) ) {
202
202
source. clone ( )
203
- } else if objtype:: real_isinstance ( source, & vm. ctx . str_type ( ) ) {
203
+ } else if objtype:: isinstance ( source, & vm. ctx . str_type ( ) ) {
204
204
let mode = compile:: Mode :: Eval ;
205
205
let source = objstr:: get_value ( source) ;
206
206
// TODO: fix this newline bug:
@@ -235,7 +235,7 @@ fn builtin_exec(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
235
235
) ;
236
236
237
237
// Determine code object:
238
- let code_obj = if objtype:: real_isinstance ( source, & vm. ctx . str_type ( ) ) {
238
+ let code_obj = if objtype:: isinstance ( source, & vm. ctx . str_type ( ) ) {
239
239
let mode = compile:: Mode :: Exec ;
240
240
let source = objstr:: get_value ( source) ;
241
241
// TODO: fix this newline bug:
@@ -246,7 +246,7 @@ fn builtin_exec(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
246
246
vm. new_exception ( syntax_error, err. to_string ( ) )
247
247
} ,
248
248
) ?
249
- } else if objtype:: real_isinstance ( source, & vm. ctx . code_type ( ) ) {
249
+ } else if objtype:: isinstance ( source, & vm. ctx . code_type ( ) ) {
250
250
source. clone ( )
251
251
} else {
252
252
return Err ( vm. new_type_error ( "source argument must be str or code object" . to_string ( ) ) ) ;
@@ -355,7 +355,7 @@ fn builtin_isinstance(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
355
355
required = [ ( obj, None ) , ( typ, Some ( vm. get_type( ) ) ) ]
356
356
) ;
357
357
358
- let isinstance = objtype:: isinstance ( vm, obj, typ) ?;
358
+ let isinstance = objtype:: real_isinstance ( vm, obj, typ) ?;
359
359
Ok ( vm. new_bool ( isinstance) )
360
360
}
361
361
@@ -366,7 +366,7 @@ fn builtin_issubclass(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
366
366
required = [ ( subclass, Some ( vm. get_type( ) ) ) , ( cls, Some ( vm. get_type( ) ) ) ]
367
367
) ;
368
368
369
- let issubclass = objtype:: issubclass ( vm, subclass, cls) ?;
369
+ let issubclass = objtype:: real_issubclass ( vm, subclass, cls) ?;
370
370
Ok ( vm. context ( ) . new_bool ( issubclass) )
371
371
}
372
372
@@ -505,7 +505,7 @@ fn builtin_next(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
505
505
match vm. call_method ( iterator, "__next__" , vec ! [ ] ) {
506
506
Ok ( value) => Ok ( value) ,
507
507
Err ( value) => {
508
- if objtype:: real_isinstance ( & value, & vm. ctx . exceptions . stop_iteration ) {
508
+ if objtype:: isinstance ( & value, & vm. ctx . exceptions . stop_iteration ) {
509
509
match default_value {
510
510
None => Err ( value) ,
511
511
Some ( value) => Ok ( value. clone ( ) ) ,
@@ -585,7 +585,7 @@ pub fn builtin_print(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
585
585
. get_optional_kwarg ( "sep" )
586
586
. filter ( |obj| !obj. is ( & vm. get_none ( ) ) ) ;
587
587
if let Some ( ref obj) = sep_arg {
588
- if !objtype:: real_isinstance ( obj, & vm. ctx . str_type ( ) ) {
588
+ if !objtype:: isinstance ( obj, & vm. ctx . str_type ( ) ) {
589
589
return Err ( vm. new_type_error ( format ! (
590
590
"sep must be None or a string, not {}" ,
591
591
objtype:: get_type_name( & obj. typ( ) )
@@ -599,7 +599,7 @@ pub fn builtin_print(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
599
599
. get_optional_kwarg ( "end" )
600
600
. filter ( |obj| !obj. is ( & vm. get_none ( ) ) ) ;
601
601
if let Some ( ref obj) = end_arg {
602
- if !objtype:: real_isinstance ( obj, & vm. ctx . str_type ( ) ) {
602
+ if !objtype:: isinstance ( obj, & vm. ctx . str_type ( ) ) {
603
603
return Err ( vm. new_type_error ( format ! (
604
604
"end must be None or a string, not {}" ,
605
605
objtype:: get_type_name( & obj. typ( ) )
@@ -822,9 +822,9 @@ pub fn builtin_build_class_(vm: &mut VirtualMachine, mut args: PyFuncArgs) -> Py
822
822
let mut metaclass = args. get_kwarg ( "metaclass" , vm. get_type ( ) ) ;
823
823
824
824
for base in bases. clone ( ) {
825
- if objtype:: issubclass ( vm, & base. typ ( ) , & metaclass) ? {
825
+ if objtype:: real_issubclass ( vm, & base. typ ( ) , & metaclass) ? {
826
826
metaclass = base. typ ( ) ;
827
- } else if !objtype:: real_issubclass ( & metaclass, & base. typ ( ) ) {
827
+ } else if !objtype:: issubclass ( & metaclass, & base. typ ( ) ) {
828
828
return Err ( vm. new_type_error ( "metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases" . to_string ( ) ) ) ;
829
829
}
830
830
}
0 commit comments