Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

I concur with Raymond. Doctest should test the representation, not value.

But I think it would be nice to support insignificant variations of the 
representation. Tracebacks already are treated specially, and different doctest 
options allow to ignore particular details. Of course ignoring the whole 
content of the dictionary will be not very useful.

   >>> dict_fun() # doctest: +ELLIPSIS
   {...}

But maybe some option should make accepting some permutations in the output. 
E.g.

   >>> dict_fun() # doctest: +PERMUTATION
   {<'foo': 1>, <'bar': 2>}

should accept both "{'foo': 1, 'bar': 2}" and "{'bar': 2, 'foo': 1}".

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32042>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to