Closed hroskes closed 3 years ago
Drat, I knew I shouldn't have released so soon! I think I see why this is happening. Not sure how to fix yet.
Turns out inheritance is really complicated!
The only way to exactly match Python's behaviour, presumably, is to use MRO, but I really don't want to have to hackily create classes twice to get this.
OK, it's fixable for user methods quite trivially. The trick is to keep the dict passed to type
as bare-bones as possible so that Python does the heavy lifting. Magic methods will require a little more work, I think the obvious way to do this is keep two dictionaries, one recording the attributes in the chain so as not to mess with dict any more than is necessary. That is ugly, however.
btw, got this test to pass a while ago but stuck at another failing test!
Should be all fixed! The class dict is now not touched at all except to add generated methods.
Thank you so much, this looks great and works for all my tests!
Is there any chance we can get a release on pypi?
Yes, I can do that.
Thank you!
This test is for when a member is defined in the second base class but not directly in the first, when both inherit from the same grandparent class. It still fails post #30.
I can take a stab at a solution if you like.