[Python-Dev] redefining is

Tim Peters tim.one at comcast.net
Thu Mar 18 14:45:24 EST 2004


[Guido]
> ...
> (The best scheme is probably to use intern() but still use '==' for
> comparisons; '==' is smart enough to skip comparing an object to
> itself.)

Well, string_richcompare() takes that shortcut, so the advice is good, but
PyObject_RichCompare() doesn't in general (PyObject_Compare() still does,
but that's not triggered by '==').




More information about the Python-Dev mailing list