Talin wrote:

> 1) values() should be documented as list-like rather than set-like.
> (Or 
> better yet bag-like, but Python doesn't have bags. In other words,
> it's 
> really an unordered collection of items with no special indexing
> semantics or uniqueness constraint.)
> 
> My reasoning is that generally people don't expect to be able to do
> set 
> membership tests of the values of a mapping; Mostly, values() is used
> for iteration. And given that all of the set-like operations are slow,
> let's just cut to the chase and say that values() isn't a set at all.

I almost agree here, but the property that multiset(1, 2, 2) ==
multiset(2, 1, 2) seems useful for a dict values view.

OTOH, how many people have complained that given d1 == d2, d1.values()
may not equal d2.values() in 2.x? I've definitely never had any problems
with it, but then again, I find it rare that I've needed values().

Tim Delaney
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to