TypeProtocol depends on AsPyObject

This commit is contained in:
Jeong Yunwon
2022-04-17 19:12:58 +09:00
parent 3a8019baee
commit 7f9e8254c4

View File

@@ -473,7 +473,7 @@ where
}
}
pub trait TypeProtocol {
pub trait TypeProtocol: AsPyObject {
fn class(&self) -> PyLease<'_, PyType>;
fn clone_class(&self) -> PyTypeRef {
@@ -524,12 +524,6 @@ impl<T: PyObjectPayload> TypeProtocol for PyRef<T> {
}
}
impl<T: TypeProtocol> TypeProtocol for &'_ T {
fn class(&self) -> PyLease<'_, PyType> {
(&**self).class()
}
}
impl<T, P> IntoPyRef<P> for T
where
P: PyValue + IntoPyObject + From<T>,