-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace OrderedDict with dict in Examples (#463)
Summary: ### Description From Python 3.6 onwards, the standard `dict` type maintains insertion order by default. [link](https://stackoverflow.com/questions/1867861/how-to-keep-keys-values-in-same-order-as-declared) We can replace `collections.OrderedDict` with built-in python `dict` in AIT Examples and docs ### More info about OrderedDict vs dict Changed in version python 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6. - [link](https://softwaremaniacs.org/blog/2020/02/05/dicts-ordered/) Regular python `dict` preserves insertion order - That's a new feature in 3.6 (3.7 is when it's first guaranteed by the language standard) - [link](https://stackoverflow.com/questions/60446154/python-dictionary-insertion-and-deletion) Pull Request resolved: #463 Reviewed By: tenpercent Differential Revision: D44293712 Pulled By: aakhundov fbshipit-source-id: 273c519672300588d8935c2ff1142c5519a09a46
- Loading branch information
1 parent
b0ca796
commit ad80787
Showing
4 changed files
with
4 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters