How would you implement a Mixin with pyo3 #3563
-
Let say I have a class named:
And a python module using the rust mixin:
Basically it would need to call super on the parent class, but rust doesn't already know which parent is super at compile time. I tried using
But it's complaining about Mixin.new() missing 1 required positional argument self_ With:
It doesn't seem like the parent class is properly set as new fails with recursion error when calling yell using PyCell . py_super
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Try let super_ = PySuper:: new(Mixin::type_object(py), self_)?; ... I suspect that |
Beta Was this translation helpful? Give feedback.
Try
... I suspect that
py_super
is probably only looking at the typeB
, which is why you get the recursion error. Probably a design oversight.