[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Objects tupleobject.c,2.48,2.49

Guido van Rossum guido@digicool.com
Wed, 16 May 2001 10:24:55 -0500


> The question remaining is how much of this list/tuple richcmp behavior is
> guaranteed by the language and how much is just implementation-dependent
> fuzz.

Unclear what you're asking.  The language doesn't require any
particular semantics for sequence comparisons, but the language of
course includes the tuple and list squence types, and it describes
(albeing lacking some rigorous detail) what comparisons for those do.
If there are specific lacks of detail, it probably helps to think
about filling those in.

> For a more vanilla example, I removed the EQ/NE "lengths differ?"
> tuple richcmp early-exit test because I never found code that made
> it trigger. (but tons of code that gets there without triggering).
> But this has semantic implications too: an implementation without
> the early exit may call user-defined comparison routines that raise
> exceptions when comparing tuples of different lengths now.  Do you
> care?  (I don't.)

I don't care about exceptions either in this case; the shortcut seems
fair game.

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