[Python-ideas] Break the dominance of boolean values in boolean context

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Sep 14 14:59:01 CEST 2011


Nick Coghlan wrote:

>   def __in__(self, container):
>     return int(self) in container
> 
> That code involves an implicit assumption that *all* containers are
> equivalence based, and that simply isn't true - it is sometimes useful
> to create a container that relies on object identity rather than value

Maybe the right operand should be given the first chance
for this particular operator?

-- 
Greg



More information about the Python-ideas mailing list