Skip to content

Comment on Python classes aren’t always the best solutionparent

Comments

Not the one you’re replying to, but my take: The main problem with classes is that they conflate a lot of concepts that should be separate and you usually need only one or a few at once, but are 5orced into all of them. Namely:

• Product type

• Reference semantics

• Namespacing

• Pipeline-style call syntax

• Redefinition of infix operators

• Dynamic dispatch

• Subtyping

For example, you cannot have a product type with value semantics or a type that redefines infix operators but is not a product type.

AboutSource Built by g1lg1l

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