> From: Greg Ewing [mailto:greg at cosc.canterbury.ac.nz] > > Maybe dicts should have a .sortedkeys() method? The specialised > method name would help stave off any temptation to add varied sort > methods to other types. -1. I think that: d = {1: 2, 3: 4} for i in list.sorted(d): print i or d = {1: 2, 3: 4} for i in list.sorted(d.iterkeys()): print i looks very clean and unambiguous. And is even better at staving off temptation to add varied sort methods to other types. Tim Delaney
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4