-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equinox seems to break cooperative multiple inheritance #832
Comments
Thankyou for the report! This should be fixed in #834. FWIW I generally recommend against co-operative multiple inheritance (I never see this done correctly except in code I own entirely), so these days I generally prefer the abstract/final pattern instead. IMO this is more readable + is certainly more robust. This is probably contributing to not having bumped into this edge-case before. |
That would mean that every concrete class would need to duplicate the initialization code and init-variables of its superclasses. Besides the repeated code, it also breaks separation of concerns. Personally, I think it's better to just use inheritance properly. It's a shame that Python inheritance confuses people.
It's pretty straightforward in Equinox. You define All
Yeah, I realize that inheritance is unpopular 😄 |
(For the record --
I would argue that this shouldn't exist at all: an abstract class cannot be initialized by definition.) |
Right, you're basically pushing for what some people call "interface inheritance" only, which is a paradigm that many people consider to be very safe in any programming language. Nothing wrong with that, but I'd like to have some classes that have data members too. Consider an optional base class that tracks errors. It overrides certain methods and saves its results in its member variables. If I did things with ABCs only, I'd have to add a bunch of code in every concrete class that inherits from it (at the very least to write to and initialize those member variables). |
For some reason,
InputNode.__post_init__
is never called. IfDeductionSource
is removed, then it is.The text was updated successfully, but these errors were encountered: