Ich schrieb: > well, as far as i can see the relevant function is > in Objects/intobject.c, which does compare by value. so, this is > either special-cased elsewhere or not optimized (should/can it be?).
it is special-cased, but still compares by value. the relevant parts from "Python/ceval.c": case COMPARE_OP: if (PyInt_CheckExact(w) && PyInt_CheckExact(v)) { a = PyInt_AS_LONG(v); b = PyInt_AS_LONG(w); switch (oparg) { case PyCmp_EQ: res = a == b; break; } } sorry if i am being noisy. -- David. -- http://mail.python.org/mailman/listinfo/python-list