Opaque Types in Python | Hacker News
TL;DR AI
2 min readKey summary
A Hacker News discussion revisits Python opaque types and whether constructors should be public in APIs.
The post compares dataclass-based designs with underscore/private-field conventions for hiding implementation details.
It argues that Python can bypass normal initialization with low-level tricks like object.__new__, but those patterns are clunky and weakly supported by tooling.
The broader debate is how to make APIs safer and more explicit without relying on conventions that are easy to ignore.



