File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ use crate::vm::VirtualMachine;
12
12
pub struct PyInstance ;
13
13
14
14
impl PyValue for PyInstance {
15
- fn required_type ( _ctx : & PyContext ) -> PyObjectRef {
16
- panic ! ( "no specific type for PyInstance, don't type check me" )
15
+ fn required_type ( ctx : & PyContext ) -> PyObjectRef {
16
+ ctx . object ( )
17
17
}
18
18
}
19
19
Original file line number Diff line number Diff line change @@ -1567,21 +1567,9 @@ pub trait PyValue: fmt::Debug + 'static {
1567
1567
fn required_type ( ctx : & PyContext ) -> PyObjectRef ;
1568
1568
}
1569
1569
1570
- pub trait PyObjectPayload : Any + fmt:: Debug + ' static {
1571
- fn required_type ( & self , ctx : & PyContext ) -> PyObjectRef ;
1572
- }
1573
-
1574
- impl < T : PyValue + ' static > PyObjectPayload for T {
1575
- fn required_type ( & self , ctx : & PyContext ) -> PyObjectRef {
1576
- T :: required_type ( ctx)
1577
- }
1578
- }
1570
+ pub trait PyObjectPayload : Any + fmt:: Debug + ' static { }
1579
1571
1580
- impl PyObjectPayload for ( ) {
1581
- fn required_type ( & self , _ctx : & PyContext ) -> PyObjectRef {
1582
- panic ! ( "No specific python type for rust unit, don't type check" )
1583
- }
1584
- }
1572
+ impl < T : PyValue + ' static > PyObjectPayload for T { }
1585
1573
1586
1574
impl FromPyObjectRef for PyRef < PyClass > {
1587
1575
fn from_pyobj ( obj : & PyObjectRef ) -> Self {
You can’t perform that action at this time.
0 commit comments