[docs] [issue20310] Recommend using pprint for deterministic doctest

Charles-Axel Dein report at bugs.python.org
Mon Jan 20 08:19:58 CET 2014


New submission from Charles-Axel Dein:

I just thought that using pprint.pprint was an elegant solution to the non-deterministic order of repr(dict) in doctest. See for instance http://bugs.python.org/issue3332

Contrary to sorted(foo().items()):

- It provides a nice output that is exactly like a dict.
- It supports any number of nested dicts.
- It can be used in other cases as well to make doctests elegant.

----------
assignee: docs at python
components: Documentation
files: pprint_doctest.patch
keywords: patch
messages: 208526
nosy: charlax, docs at python
priority: normal
severity: normal
status: open
title: Recommend using pprint for deterministic doctest
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file33560/pprint_doctest.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20310>
_______________________________________


More information about the docs mailing list