Subclass a rust class from python #3938
Unanswered
mirage2032
asked this question in
Questions
Replies: 1 comment 7 replies
-
You should write fn foo(slf: &Bound<Self>) -> PyResult<()> {
self.call_method0("bar")?;
Ok(())
} NB this uses the |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'll try to shortly explain what I'm trying to do
In rust I want to have a class A with a foo method that calls bar
In python I want to implement the B class that inherits from A and implements bar()
Similar to this
How would I make rust know that bar() is an abstract method and to call it's python implementation?
I did quite a few experiments on this but with no success
Beta Was this translation helpful? Give feedback.
All reactions