[Python-Dev] A proposal has surfaced on comp.lang.python toredefine "is"

Michael Hudson mwh at python.net
Thu Mar 18 05:46:57 EST 2004


"Andrew Koenig" <ark-mlist at att.net> writes:

>> I'm curious what the reason is to want to redefine 'is' for
>> immutables.  If I understand Andrew, it's fix broken programs after
>> the fact (almost as if by time machine :-).
>> 
>> It seems to me that 'is' should never be used for immutables except
>> for singletons like None.  Perhaps PyChecker should warn about
>> inappropriate use of 'is' to compare two immutable objects, unless one
>> of them is None?  This would be a cheaper solution than changing the
>> implementation.
>
> It wasn't my proposal, so I don't know the reason.

AFAIK this came up in a thread about reload() where the complaint was
that reload() didn't do what the OP suggested.

The consequent 'is' proposal isn't so much the tail wagging the dog as
the handbrake wagging the canoe.

I'd much rather people just knew how Python worked (and also agree
with Peter Norvig: Common Lisp has *five* equality predicates, and
still you end up writing your own every now and again).

Cheers,
mwh

-- 
  Screaming 14-year-old boys attempting to prove to each other that
  they are more 3133t than j00.
         -- Reason #8 for quitting slashdot today, from
            http://www.cs.washington.edu/homes/klee/misc/slashdot.html



More information about the Python-Dev mailing list