You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think PyO3 currently exposes an API to get super() from Rust.
As far as I'm aware there aren't special C APIs to call super(), instead I think ffi::PySuper_Type can be cast to &PyType and we can then use .call1((type, obj)) to fill in the arguments. I think we'd always need to use the two-argument form as I don't think the PEP 3135 syntax sugar can apply here.
Some ideas what could be done:
Add a PySuper type to pyo3::types, with constructors like PySuper::new(ty: &PyType, obj: &PyAny) -> PyResult<PySuper>
Maybe add PyAny::super() which calls PySuper::new with the object and its type for convenience.
The text was updated successfully, but these errors were encountered:
I don't think PyO3 currently exposes an API to get
super()
from Rust.As far as I'm aware there aren't special C APIs to call
super()
, instead I thinkffi::PySuper_Type
can be cast to&PyType
and we can then use.call1((type, obj))
to fill in the arguments. I think we'd always need to use the two-argument form as I don't think the PEP 3135 syntax sugar can apply here.Some ideas what could be done:
PySuper
type topyo3::types
, with constructors likePySuper::new(ty: &PyType, obj: &PyAny) -> PyResult<PySuper>
PyAny::super()
which callsPySuper::new
with the object and its type for convenience.The text was updated successfully, but these errors were encountered: