> 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/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4