Inconsistent viewkeys behaviour

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Apr 28 20:08:49 EDT 2014


Terry Reedy wrote:
> The left operand determines the result. The manual specifies that < and 
>  > do not have to be consistent. But I suspect that when 3.x dict.keys() 
> was backported to 2.7.0, no one thought to update set, whereas the 
> backported key view code already had the comparison.

The question is why set() is raising an exception
instead of returning NotImplemented to give the
other operand a chance.

-- 
Greg




More information about the Python-list mailing list