-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: OrderedDict -> Dict #29923
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
CLN: OrderedDict -> Dict #29923
Conversation
Can you use dict literals where possible, i.e. Else LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Should maybe add a code check as well to not use OrderedDict, or is there any outstanding reason still to use?
@alimcmaster1 yeah lgtm. but agree we need a code check here, can you add. |
Thanks @topper-123 updated as per your comments. @jreback sure will add a code check in a follow up - there are still some more references to remove but ill save those for next PR |
@@ -2992,7 +2991,7 @@ def _write_map(self): | |||
the map with 0s. The second call writes the final map locations when | |||
all blocks have been written.""" | |||
if self._map is None: | |||
self._map = OrderedDict( | |||
self._map = dict( | |||
( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A last one missing here, else looks good.
Thanks @alimcmaster1 |
black pandas
As of CPython 3.6 the implementation of dict maintains insertion order.
This became a language feature in python 3.7.
Note in python 3.8 support for reversed(dict) was added - but we don't seem to use that in the use cases i've eliminated.
There is more to do here.