Replies: 1 comment 1 reply
-
I think the error that's firing is this one: https://github.com/python/cpython/blob/0566ab9c4d966c7280a1c02fdeea8129ba65de81/Objects/typeobject.c#L8318 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In a different question, I found out the py_super method doesn't really help calling the real super method and it has to be called as such:
Then it seems it's possible to have a reference to the class by making new a class method.
So something like this can be used:
This will call the
__new__
of the base super class but for some reasons it fails with:But in reality the
builtins.Mixin.__new__
is indeed called.Here's a more complete code snippet:
rust:
Python code:
This will fail in A.new when calling super (
object.__new__
)It's as if PyO3 had to mark the
__new__
method has called, but it doesn't and Python thinks it didn't call the builtin method.Beta Was this translation helpful? Give feedback.
All reactions