Skip to content

Comment on Python classes aren’t always the best solutionparent

Comments

And almost never use inheritance, especially if that inheritance chain goes beyond one ancestor.

With Python's duck typing, I'm not even sure of a case where inheritance is even strictly necessary beyond custom exceptions.

with Raku’s powerful, yet simple, OO you get role composition for code organization and can reserve inheritance to reflect real structure in your data model

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.