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

2006-03-31 Thread Taro Ogawa
Taro Ogawa taroso at gmail.com writes: Nick Coghlan ncoghlan at gmail.com writes: There are three big use cases: ... delurk ... Apologies - this was posted via gmane and the post I responded to appeared in the gmane.comp.python.devel.3000 tree... I'll repost there (and check gmane a

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

2006-03-30 Thread Taro Ogawa
Nick Coghlan ncoghlan at gmail.com writes: There are three big use cases: dict.keys dict.values dict.items Currently these all return lists, which may be expensive in terms of copying. They all have iter* variants which while memory efficient, are far less convenient to work with.

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

2006-03-29 Thread Nick Coghlan
Paul Moore wrote: On 3/29/06, Brett Cannon [EMAIL PROTECTED] wrote: Without a direct reason in terms of the language needing a standardization of an interface, perhaps we just don't need views. If people want their iterator to have a __len__ method, then fine, they can add it without

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

2006-03-29 Thread Nick Coghlan
Nick Coghlan wrote: a message to the wrong list Darn, I'd hoped I'd caught that in time :( Sorry folks. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia ---

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

2006-03-24 Thread Nick Coghlan
Greg Ewing wrote: Guido van Rossum wrote: Its maps have methods to return keys, values and items, but these return neither new lists nor iterators; they return views which obey set (or multiset, in the case of items) semantics. I'd like to explore this as an alternative to making keys()

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

2006-03-24 Thread Guido van Rossum
On 3/24/06, Nick Coghlan [EMAIL PROTECTED] wrote: I do find it somewhat interesting that we're considering moving the standard containers to a more numpy-ish view of the world, though (i.e. one where multiple mutable views of a data structure are common in order to avoid unnecessary copying)