[Python-Dev] test_doctest failing, but perhaps by accident

Michael Hudson mwh21@cam.ac.uk
28 Mar 2001 23:55:36 +0100


"Tim Peters" <tim.one@home.com> writes:

> I'm calling this one a bug in doctest.py, and will fix it there.  Ugly:
> since we can longer rely on list.sort() not raising exceptions, it won't be
> enough to replace the existing
> 
>     for k, v in dict.items():
> 
> with
> 
>     items = dict.items()
>     items.sort()
>     for k, v in items:

Hmm, reading through these posts for summary purposes, it occurs to me
that this *is* safe, 'cause item 0 of the tuples will always be
distinct strings, and as equal-length tuples are compared
lexicographically, the values will never actually be compared!

pointless-ly y'rs
M.

-- 
93. When someone says "I want a programming language in which I
    need only say what I wish done," give him a lollipop.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html