]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Rich comparisons:
authorGuido van Rossum <guido@python.org>
Thu, 18 Jan 2001 00:39:02 +0000 (00:39 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 18 Jan 2001 00:39:02 +0000 (00:39 +0000)
commitb932420cc7808862bc7e87dad7b44748f7735012
treeedbdaef0014a1390ee250593ba68e85dfcfc45da
parentf77bc62e7351a052f2127221afa43bbf442d8c96
Rich comparisons:

- Use PyObject_RichCompareBool() when comparing keys; this makes the
  error handling cleaner.

- There were two implementations for dictionary comparison, an old one
  (#ifdef'ed out) and a new one.  Got rid of the old one, which was
  abandoned years ago.

- In the characterize() function, part of dictionary comparison, use
  PyObject_RichCompareBool() to compare keys and values instead.  But
  continue to use PyObject_Compare() for comparing the final
  (deciding) elements.

- Align the comments in the type struct initializer.

Note: I don't implement rich comparison for dictionaries -- there
doesn't seem to be much to be gained.  (The existing comparison
already decides that shorter dicts are always smaller than longer
dicts.)
Objects/dictobject.c