[Python-ideas] doctest

Mark Janssen dreamingforward at gmail.com
Fri Mar 2 04:39:31 CET 2012

On Thu, Mar 1, 2012 at 8:31 PM, Guido van Rossum <guido at python.org> wrote:

> On Thu, Mar 1, 2012 at 6:31 PM, Mark Janssen <dreamingforward at gmail.com>
> wrote:
> > I just thought of something:  isn't the obvious solution is for doctest
> to
> > test the type of an expression's output and if it's in the set of
> unordered
> > types {set, dict} to run sort() on it?  Then the docstring author can
> just
> > put the (sorted) output of what's expected....
> What if the output is a list of dicts?

Right, thanks.  Although I suppose in theory one could go deep -- take the
deepcopy code and instead of an exact copy replace any unordered types with
their sorted copies.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120301/c5ab2aa0/attachment.html>

More information about the Python-ideas mailing list