On Thu, 29 Oct 2015, Nathann Cohen wrote:
Now, to give a testable example of this kind of function one must put
sorted() to output or do someting like (1 in result, 2 in result) --> True.
Should we show them to user? I think that this could be argued to both
directions.
In those cases I'd say that '# random' does the job. The users may not
understand it though. Perhaps a 'platform-dependent' doctest or
something?
Hmm... yes, we could have "# random order". But then the example is not
really testable, i.e. it just tests if the code does not stuck. So which
one we prefer:
- Be nice to user with # random order
- Be better developer with sort(result) or something similar
- Make extra work and have both, one as an example and another as test.
- Make much more complicated doctest framework with some non-user-visible
additions like "# sort" that will be used in a test but not shown.
--
Jori Mäntysalo