News for hackers. Stuff that matters.
Re:You might not need a Python class by thenaturalist on Thursday July 24, 2025 @04:31PM (#44675732)
> classes are a bad way to model data imo

Genuinely curious: why?

Re:You might not need a Python class by xigoi on Friday July 25, 2025 @05:51PM (#44688921)
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.