popitem() in dictionary guarantee to return last inserted pair for 3.7 and onward. Dictionary is unordered type. So, how dictionary is able to achieve this?
Asked
Active
Viewed 83 times
1 Answers
1
It is no longer unordered starting 3.6 (implementation detail) and guaranteed as of 3.7. So naturally methods that are based on order have predictable results now.

Anonymous
- 11,740
- 3
- 40
- 50