[Python-Dev] redefining is (original) (raw)

Greg Ewing greg at cosc.canterbury.ac.nz
Sun Mar 21 19:22:41 EST 2004


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

There are certainly more than three meaningful forms of equivalence. I claim, however, that these three forms already have special status in the language, because it is implementation-defined whether two occurrences of the same string literal refer to the same object.

But this special status is only spelled out for certain fully-immutable objects, for which your "substitutability" relation is equivalent to "==".

In all of this, I've yet to see a single use case put forward where it would be wrong to use "==" instead of "substitutability", let alone one frequently enough encountered to be worth adding a new operator or changing the semantics of an existing one.

Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg at cosc.canterbury.ac.nz +--------------------------------------+



More information about the Python-Dev mailing list