]> granicus.if.org Git - python/commit
Convert to rich comparisons:
authorGuido van Rossum <guido@python.org>
Wed, 17 Jan 2001 22:11:59 +0000 (22:11 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 17 Jan 2001 22:11:59 +0000 (22:11 +0000)
commit65e1cea6e372ed809501cf5b927a65c111f79cd3
treec1d623c8cc41e1dffca50c4db184812b24bf161c
parent7d6457743a2f48888dd10a41cee0e072fb4595ce
Convert to rich comparisons:

- sort's docompare() calls RichCompare(Py_LT).

- list_contains(), list_index(), listcount(), listremove() call
  RichCompare(Py_EQ).

- Get rid of list_compare(), in favor of new list_richcompare().  The
  latter does some nice shortcuts, like when == or != is requested, it
  first compares the lengths for trivial accept/reject.  Then it goes
  over the items until it finds an index where the items differe; then
  it does more shortcut magic to minimize the number of additional
  comparisons.

- Aligned the comments for large struct initializers.
Objects/listobject.c