On Sun, May 06, 2001 at 02:15:57PM -0400, Tim Peters wrote: > Given the new dict iterators in 2.2, there's an easier fast way that doesn't > mutate the dict even under the covers: > def arb(dict): > if dict: > return dict.iteritems().next() > raise KeyError("arb passed an empty dict") You probably want: arb = dict.iteritems().next so that you don't keep on returning the same key,value pair. -- Thomas Wouters <thomas@xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
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