3 ms·
I'm not sure what you're trying to imply. If it's regarding the order, you're wrong. The keys returned by either `keys()` or by `__iter__` are returned in arbit
by omegote 8y ago
I'm not sure what you're trying to imply. If it's regarding the order, you're wrong. The keys returned by either `keys()` or by `__iter__` are returned in arbitrary order [1].
[1] https://docs.python.org/2/tutorial/datastructures.html#dictionaries https://docs.python.org/2/tutorial/datastructures.html#dicti...
- pizzaburek 8y agoThe whole cheatsheet is clearly in Python 3, where the same doc page that you linked states: Performing list(d) on a dictionary returns a list of all the keys used in the dictionary, in insertion order ...
- detaro 8y agoonly specified as such since Python 3.7, which hadn't been released when this cheat sheet was written, at least if the date at the top is accurate. EDIT: clicking through to GitHub, the date is clearly not up-to-date, so this might have been added later.