File tree Expand file tree Collapse file tree 2 files changed +2
-30
lines changed Expand file tree Collapse file tree 2 files changed +2
-30
lines changed Original file line number Diff line number Diff line change @@ -64,24 +64,11 @@ pub struct PyMethod {
64
64
// TODO: these shouldn't be public
65
65
pub object : PyObjectRef ,
66
66
pub function : PyObjectRef ,
67
- pub actually_bind : bool ,
68
67
}
69
68
70
69
impl PyMethod {
71
70
pub fn new ( object : PyObjectRef , function : PyObjectRef ) -> Self {
72
- PyMethod {
73
- object,
74
- function,
75
- actually_bind : true ,
76
- }
77
- }
78
-
79
- pub fn new_nobind ( object : PyObjectRef , function : PyObjectRef ) -> Self {
80
- PyMethod {
81
- object,
82
- function,
83
- actually_bind : false ,
84
- }
71
+ PyMethod { object, function }
85
72
}
86
73
87
74
fn getattribute ( & self , name : PyStringRef , vm : & VirtualMachine ) -> PyResult {
Original file line number Diff line number Diff line change @@ -664,14 +664,9 @@ impl VirtualMachine {
664
664
} else if let Some ( PyMethod {
665
665
ref function,
666
666
ref object,
667
- actually_bind,
668
667
} ) = func_ref. payload ( )
669
668
{
670
- let args = if * actually_bind {
671
- args. insert ( object. clone ( ) )
672
- } else {
673
- args
674
- } ;
669
+ let args = args. insert ( object. clone ( ) ) ;
675
670
self . invoke ( & function, args)
676
671
} else if let Some ( builtin_func) = func_ref. payload :: < PyBuiltinFunction > ( ) {
677
672
builtin_func. as_func ( ) ( self , args)
@@ -1450,16 +1445,6 @@ impl VirtualMachine {
1450
1445
attr_value : impl Into < PyObjectRef > ,
1451
1446
) -> PyResult < ( ) > {
1452
1447
let val = attr_value. into ( ) ;
1453
- let val = if val
1454
- . class ( )
1455
- . is ( & self . ctx . types . builtin_function_or_method_type )
1456
- {
1457
- PyMethod :: new_nobind ( module. clone ( ) , val)
1458
- . into_ref ( self )
1459
- . into_object ( )
1460
- } else {
1461
- val
1462
- } ;
1463
1448
self . set_attr ( module, attr_name, val) ?;
1464
1449
Ok ( ( ) )
1465
1450
}
You can’t perform that action at this time.
0 commit comments