|
|
|
|
|
by closed
933 days ago
|
|
Having had the great pleasure of refactoring a few python libraries, I've had to encouraged people to switch away from inheritance. You often get a ton of methods / attributes on the child class, which gets hard to keep tabs on. You have to be careful not to use the same names for things. (The worst is that someone uses this broken encapsulation and relies on things across parent classes via the child). I get that inheritance can go okay for simple cases, but have seen enough chaotic uses of it that I'd just encourage people to write the boilerplate for forwarding methods. |
|
Inheritance turns the functional structure of your code into mud. Unless inheritance is absolutely the best design, better to drop it.