Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No need for "Ordered" dict #425

Merged
merged 6 commits into from
Apr 14, 2022
Merged

No need for "Ordered" dict #425

merged 6 commits into from
Apr 14, 2022

Conversation

Christian-B
Copy link
Member

As of python 3.7 (the first version we officially support) all dicts are now order guaranteed.
Even python 3.6 had it just not made if a guarantee

The OrderedDict and our DefaultOrderedDict have a few minor advantages
such as ability to iterate reversed. (python 3.8 normal dicts can but not 3.7 or 3.6)
Ability to .move_to_end() In normal dicts you have to remove and readded to get that affects
But are about 30% slower and do use more ram
ref: https://realpython.com/python-ordereddict/

This set of PRs changes the "ordered" to normal as far as possible.

They are all independent except that this PACMAN one must be done before (or at the same time as) the utils one!

OrderDict was kept in SpinUtils Ordered Sets as that supports reverse.

SpallocServer not done as 1. it uses move_to_end and 2 is actively being replaced with a Java version.

tested by:

TODO!

@dkfellows dkfellows merged commit 922ae6c into master Apr 14, 2022
@dkfellows dkfellows deleted the dict branch April 14, 2022 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants