Re:A high-performance, zero-overhead, extensible Python comp...
by actionfromafar on Wednesday September 18, 2024 @05:33PM
(#41585814)
The trade-off is a bit of speed.
[ Parent
| on HN ]
Re:A high-performance, zero-overhead, extensible Python comp...
by cjbillington on Wednesday September 18, 2024 @06:44PM
(#41586438)
This might be what you meant, but the ordered dicts are faster, no? I believe ordering was initially an implementation detail that arose as part of performance optimisations, and only later declared officially part of the spec.
Re:A high-performance, zero-overhead, extensible Python comp...
by Someone on Thursday September 19, 2024 @02:28AM
(#41589143)
> but the ordered dicts are faster, no?
They may be in the current implementations, but removing an implementation constraint can only increase the solution space, so it cannot make the best implementation slower.
As a trivial example, the current implementation that guarantees iteration happens in insertion order also is a valid implementation for a spec that does not require that guarantee.