Closed torokati44 closed 1 year ago
Do you think you'll be able to look into this sometime, @wlav? My guess is that the generation of the dispatcher class doesn't traverse all the way up on the inheritance tree when collecting methods to dispatch, so perhaps not all available methods (declared in place or inherited from anywhere) get a dispatcher into Python...?
Fixed in repo.
Before, only the immediate bases (i.e. 2 layers up into the inheritance tree) were search. Now the search is done recursively.
Ah, so my guess was right. Thank you so much!
I can confirm the fix worked on the example snippet above. Now waiting for a new release on PyPI soon. :pray:
This was a rather convoluted title, so let me illustrate it with code instead:
I would expect the output of this to be:
But actually it is this:
For whatever reason, and only when called from C++,
f1
(and onlyf1
) is silently not being overridden by the Python subclass.