@@ -694,7 +694,7 @@ impl Default for PyContext {
694
694
pub struct PyObject {
695
695
pub typ : PyObjectRef ,
696
696
pub dict : Option < RefCell < PyAttributes > > , // __dict__ member
697
- pub payload : Box < dyn PyValuePayload > ,
697
+ pub payload : Box < dyn PyObjectPayload > ,
698
698
}
699
699
700
700
/// A reference to a Python object.
@@ -1543,7 +1543,7 @@ impl PyValue for PyIteratorValue {
1543
1543
}
1544
1544
1545
1545
impl PyObject {
1546
- pub fn new < T : PyValuePayload > ( payload : T , typ : PyObjectRef ) -> PyObjectRef {
1546
+ pub fn new < T : PyObjectPayload > ( payload : T , typ : PyObjectRef ) -> PyObjectRef {
1547
1547
PyObject {
1548
1548
typ,
1549
1549
dict : Some ( RefCell :: new ( PyAttributes :: new ( ) ) ) ,
@@ -1567,17 +1567,17 @@ pub trait PyValue: fmt::Debug + 'static {
1567
1567
fn required_type ( ctx : & PyContext ) -> PyObjectRef ;
1568
1568
}
1569
1569
1570
- pub trait PyValuePayload : Any + fmt:: Debug + ' static {
1570
+ pub trait PyObjectPayload : Any + fmt:: Debug + ' static {
1571
1571
fn required_type ( & self , ctx : & PyContext ) -> PyObjectRef ;
1572
1572
}
1573
1573
1574
- impl < T : PyValue + ' static > PyValuePayload for T {
1574
+ impl < T : PyValue + ' static > PyObjectPayload for T {
1575
1575
fn required_type ( & self , ctx : & PyContext ) -> PyObjectRef {
1576
1576
T :: required_type ( ctx)
1577
1577
}
1578
1578
}
1579
1579
1580
- impl PyValuePayload for ( ) {
1580
+ impl PyObjectPayload for ( ) {
1581
1581
fn required_type ( & self , _ctx : & PyContext ) -> PyObjectRef {
1582
1582
panic ! ( "No specific python type for rust unit, don't type check" )
1583
1583
}
0 commit comments