4 ms·
You don't need a Python object model when implementing a highly specialized dictionary that can only store very specific data types. But Python dict is a generi
by int_19h 3y ago
You don't need a Python object model when implementing a highly specialized dictionary that can only store very specific data types. But Python dict is a generic collection type that is designed to store any Python object (or rather, reference to such, since Python has reference semantics for anything).
And this part:
> if anyone would seriously consider improving CPython's performance they wouldn't touch dictionaries, at least not at first.
is just straight up nonsense, given how many times over Python's history dicts have been substantially rewritten. As it happens, I work on Python dev tooling, and the CPython team changing internal data structures for perf reasons has been a recurring headache for me, so I know full well what I'm talking about here.