[Python-checkins] python/dist/src/Objects listobject.c,2.134,2.135

Guido van Rossum guido@python.org
2002年9月05日 16:18:37 -0400


> This was originally about Raymond's change which was like:
>> 	cmp = PyObject_RichCompareBool(...);
> 	if (cmp > 0)
> 		return 1;
> 	if (cmp < 0)
> 		return -1;
> 	return 0;
>> I was wondering if it might be better to do:
>> 	cmp = PyObject_RichCompareBool(...);
> 	return cmp;
>> and avoid checking to return -1, 0, or 1 since this is the documented
> return values for PyObject_RichCompareBool().

Ah. Yes.
--Guido van Rossum (home page: http://www.python.org/~guido/)

AltStyle によって変換されたページ (->オリジナル) /