Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Last active July 15, 2020 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/6653414c8ccc3c5ac8a0b33c33ad40c9 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/6653414c8ccc3c5ac8a0b33c33ad40c9 to your computer and use it in GitHub Desktop.
OrderedDict Dict
Good at reordering operations Good at mapping operations
Space efficiency, iteration speed, and the performance of update operations were secondary Tracking insertion order was secondary.
OrderedDict has a move_to_end() method to efficiently reposition an element to an endpoint That feature is not available in dict
reversed() function is supported Not supported till python version 3.8
Equality operation checks for matching order Mappings (instances of dict) compare equal if and only if they have equal (key, value) pairs
popitem() accepts optional argument to specify which item to be popped popitem() removes and returns the last inserted item(key,value) from the dictionary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment