Hacker News new | ask | show | jobs
by cbsmith 637 days ago
Python classes are basically dictionaries that have a distinct type bound to them. Alternatively you can subclass from dictionary to give yourself a distinct type but still be a dictionary. Slotted classes are basically named tuples (and of course, Python has actual named tuples and dataclasses), so there's a lot of ways to "tag" a collection with a specific type in mind.
1 comments

A typed dict is more like what I mean. Obviously I know about classes as I'm no stranger to OO.