On 2/10/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
> > (I had dreams
> > of caching this by converting the values to a set, but was rudely
> > awakened when I realized that values don't need to be hashable. So
> > dict.values(), unlike dict.keys() and dict.items(), cannot return an
> > object that behaves and is as efficient as a set, without copying
> > anything; the only property I plan to implement (and have already done
> > so) is __iter__ which gives all the values in random order.
>
> Yeah, unless you want partial caching for those that are hashable, but
> at that point it probably isn't worth it.

I'd rather make it obvious that the values() view isn't all that
useful, rather than trying to hide the flaws until they pop up when
you least expect them. After all, the list returned by the current
values() method isn't all that useful either, so it's not like people
expect a lot from .values().

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to