On Thu, 05 May 2011 21:48:20 +1000, Chris Angelico wrote: > 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.
`is` is supposed to be a *fast* operator, not even slower than equality testing. -- Steven -- http://mail.python.org/mailman/listinfo/python-list