On Thu, May 5, 2011 at 9:44 PM, Mel <mwil...@the-wire.com> wrote: > John Nagle wrote: >> On 5/4/2011 5:46 PM, harrismh777 wrote: >>> Or, as stated earlier, Python should not allow 'is' on immutable objects. >> >> A reasonable compromise would be that "is" is treated as "==" on >> immutable objects. > > I foresee trouble testing among float(5), int(5), Decimal(5) ...
Define 'x is y' as 'type(x)==type(y) and isinstance(x,(int,float,tuple,etc,etc,etc)) and x==y' then. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list