[Python-Dev] Re: Re: lists v. tuples (original) (raw)

Guido van Rossum guido@python.org
Sun, 16 Mar 2003 20:50:40 -0500


Guido: > And I'm still hoping to remove cmp; there should be only one > way to overload comparisons.

[Greg]

I'd rather you kept it and re-defined it to mean "compare for arbitrary ordering". (Maybe change its name if there are backwards-compatibility issues.)

Hm, that's not what it does now, and an arbitrary ordering is better defined by a "less" style operator.

I've been thinking of before and a built-in before(x, y) -> bool. (Not less / less, because IMO that's to close to lt / <.)

BTW, there are two possible uses for before(): it could be used to impose an arbitrary ordering for types that don't have one now (like complex); and it could be used to impose an ordering between different types (like numbers and strings). I've got a gut feeling that the requirements for these are somewhat different, but can't quite pinpoint it.

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