Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> If base classes were only allowed to be used in inheritance and couldn't be parameters, generics, etc then that would force users to create base classes and public interfaces in pairs and would decouple their names and by writing the public interface down as its own thing developers would be more likely to focus on that design.

I agree and like this principle, however, but what would be the difference between the base class and a mixin class then?



TIL that in Python you cannot use a mixin class to provide implementation for an abstract base class that defines the interface.

In other words, in the inheritance tree, the class providing the common implementation must sit between the interface class and the concrete classes.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: