[Python-3000] dict view operations

Georg Brandl g.brandl at gmx.net
Tue Sep 4 19:37:26 CEST 2007


Georg Brandl schrieb:
> While looking at documenting the dict view changes, I came across an
> inconsistency in how the dict views' set-like operations are implemented:
> with sets/frozensets, the operator versions only work if the other operand
> is a set/frozenset, while the dict view operators allow any iterable.
> 
> Do we care?

Oh, and another thing: the items views can contain unhashable values, so

d.items() & d.items()

will fail for such dictionaries since the operands are converted to sets
before doing the intersection.

I suspect there's nothing that can easily be done about that though...

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-3000 mailing list