Hacker News new | ask | show | jobs
by frou_dh 682 days ago
Python arguably has better support for working with sum-types (algebraic types) than TypeScript does, because the language actually has a `match` statement (since 2021). Define a sum-type as a Union of dataclasses and the static type-checker (Pyright) can even tell you when your pattern-matching statements are non-exhaustive.

Do you track such developments, or spend the time dreaming up these elaborate theories? :)

1 comments

Not particularly (point taken), but I _do_ note that describing a napkin-sketch as an 'elaborate theory' is perhaps more flattering than you mean it to be ;)