in article slrn9dbfe5.qmh.apardon at trout.vub.ac.be, apardon at trout.vub.ac.be at apardon at trout.vub.ac.be wrote on 4/12/01 10:33 AM: > Is there a module that provides a sorted map. > > What I need is a map type that allow you to visit > all members in key order. Also the possibility > to look for the next in line after a search > would be nice. Is there a module that already > implements such a maptype or do I have to do > it myself? >From the Python Cookbook: "Dictionaries can't be sorted -- a mapping has no ordering! -- so, when you feel the need to sort one, you no doubt want to sort its *keys* (in a separate list). Sorting (key,value) pairs (items) is simplest, but not fastest." http://www.activestate.com/ASPN/Python/Cookbook/Recipe/52306 Article and associated code by Alex Martelli, which, if you're new around here, means it's definitive. -M You're smart; why haven't you learned Python yet? http://diveintopython.org/
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