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

Skip Montanaro skip at pobox.com
Wed Mar 17 18:44:38 EST 2004


    Andrew> Don't expose the implementation to users needlessly.

    Andrew> This kind of implementation-defined behavior makes me nervous,
    Andrew> because it makes it easy to write programs with bugs that no
    Andrew> amount of testing can ever reveal.

I don't know what the original impetus for this long discussion of "is" vs
"==" was, but my guess is that it was misguided (premature) optimization.
The somewhat anomalous behavior of "is" in CPython is an implementation
detail.  If Jython was used as the basis for comparison I suspect the
implemntation might match the definition a bit more precisely.

I'm not sure what the use case for the recursive "is" is, but it would be no
cheaper than "==" in that case.  I'm disinclined to change things.

Skip




More information about the Python-Dev mailing list