You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CPython has been guaranteeing insertion order in dictionaries since 3.6, so the use of OrderedDict looks a bit like an anachronism to me. It's also bothersome in the debug prints, because it'll print things in insertion order, rather than with alphabetical keys (so in large dumps it becomes impossible to verify if a given key is absent or present).
Not sure if there are any other reasons to keep it (other than inertia), but IMO this would be a nice cleanup.
The text was updated successfully, but these errors were encountered:
Personally, I'm not against using OrderedDict because I like that it expresses a requirement on the dictionary instead of that behavior being implicit. This guarantees that it works regardless of which Python version (or interpreter) I use.
CPython has been guaranteeing insertion order in dictionaries since 3.6, so the use of
OrderedDict
looks a bit like an anachronism to me. It's also bothersome in the debug prints, because it'll print things in insertion order, rather than with alphabetical keys (so in large dumps it becomes impossible to verify if a given key is absent or present).Not sure if there are any other reasons to keep it (other than inertia), but IMO this would be a nice cleanup.
The text was updated successfully, but these errors were encountered: