[Python-3000] Iterators for dict keys, values, and items == annoying :)

Aahz aahz at pythoncraft.com
Fri Mar 24 16:33:27 CET 2006


On Fri, Mar 24, 2006, Greg Ewing wrote:
>
> I've speculated that perhaps it should be illegal to
> use an iterator that way, and you would instead have
> to say
> 
>    for x from iterator:
> 
> This would force people to keep the distinction firmly
> in mind and might lead to less confusion.

How would you distinguish?  What about objects that are their own
iterator (such as files)?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Look, it's your affair if you want to play with five people, but don't
go calling it doubles."  --John Cleese anticipates Usenet


More information about the Python-3000 mailing list