[Python-3000] Thoughts on dictionary views

Steven Bethard steven.bethard at gmail.com
Wed Feb 21 01:35:15 CET 2007


On 2/20/07, Steven Bethard <steven.bethard at gmail.com> wrote:
> Just to clarfiy, you're suggesting that we still change .keys()
> .values() and .items() to iterators, right?

On 2/20/07, Guido van Rossum <guido at python.org> wrote:
> But this isn't really easier to explain to noobs than views, is it?

On 2/20/07, Steven Bethard <steven.bethard at gmail.com> wrote:
> On the other hand, when they're told "it's a dict key view object",
> they can't use any existing knowledge. They have to go and look up the
> API for what exactly a dict key view object does. And once they've
> learned what API a dict key view object supports, that knowledge is
> not really helpful in any new situations. They won't see key views on
> lists, sets or deques, for example.

On 2/20/07, Guido van Rossum <guido at python.org> wrote:
> But they will see them (I hope) on other mappings.

Presumably.

All I was really pointing out is that your average Python programmer
encounters more iterable objects than they do mapping-like objects.
(Inevitable, of course, since all mapping-like objects are iterable.)
My conclusion was therefore that iterability was a more basic part of
Python.

IMVHO, the fewer building blocks you have to understand to use the
basic Python types, the better. But I'm going to let the discussion go
for a while now, because it's a much better use of your time
convincing Raymond than it is convincing me. ;-)

STeVe
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy


More information about the Python-3000 mailing list