[Python-Dev] Re: Sets: elt in dict, lst.include
Mon, 29 Jan 2001 20:03:41 +0100
With all this confusion about how to actually write the
iteration on dictionary items, wouldn't it make more sense
to implement an extension module which then provides a __getitem__
style iterator for dictionaries by interfacing to PyDict_Next() ?
The module could have three different iterators:
1. iterate over items
2. ... over keys
3. ... over values
The reasoning behind this is that the __getitem__ interface
is well established and this doesn't introduce any new
syntax while still providing speed and flexibility.
Python Pages: http://www.lemburg.com/python/