[Python-Dev] Re: Sets: elt in dict, lst.include

M.-A. Lemburg mal@lemburg.com
2001年1月29日 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.
-- 
Marc-Andre Lemburg
______________________________________________________________________
Company: http://www.egenix.com/
Consulting: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/

AltStyle によって変換されたページ (->オリジナル) /