[Python-Dev] Check dict implementation details (original) (raw)
Serhiy Storchaka storchaka at gmail.com
Sat Oct 8 06:01:27 EDT 2016
- Previous message (by thread): [Python-Dev] Summary of Python tracker Issues
- Next message (by thread): [Python-Dev] Check dict implementation details
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Since dict is ordered in CPython 3.6, it can be used instead of OrderedDict in some places (e.g. for implementing simple limited caches). But since this is implementation detail, it can't be used in the stdlib unconditionally. Needed a way to check whether dict is ordered.
Actually there are two levels of "ordering".
Dict without deletions is iterated in the order of adding items. Raymond's original compact dict implementation satisfied this claim.
In addition the order is preserved after deletion operations. Naoki's implementation satisfies this more strong claim.
- Previous message (by thread): [Python-Dev] Summary of Python tracker Issues
- Next message (by thread): [Python-Dev] Check dict implementation details
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]