[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Objects object.c,2.95,2.96
Tim Peters
tim_one@email.msn.com
Fri, 18 Aug 2000 14:37:19 -0400
[Trent Mick]
> > ...
> > if (vtp->tp_compare == NULL) {
> > ! Py_uintptr_t iv = (Py_uintptr_t)v;
> > ! Py_uintptr_t iw = (Py_uintptr_t)w;
> > ! return (iv < iw) ? -1 : 1;
> > }
> Can't you just do the cast for the comparison instead of making new
> variables?
Any compiler worth beans will optimize them out of existence. In the
meantime, it makes each line (to my eyes) short, clear, and something I can
set a debugger breakpoint on in debug mode if I suspect the cast isn't
working as intended.