Re: [Tutor] doctest question

2012-11-27 Thread Steven D'Aprano
On 27/11/12 20:50, Albert-Jan Roskam wrote: Function name "_setMultRespDefsEx" is not self-explanatory, or even *hint* at what the function is supposed to do. It appears to take a dictionary of stuff, and formats it as a string. It would be nice[1] if your docstring explained what sort of stuff.

Re: [Tutor] doctest question

2012-11-27 Thread Dave Angel
On 11/27/2012 04:50 AM, Albert-Jan Roskam wrote: > >> On 27/11/12 08:06, Albert-Jan Roskam wrote: >>> (Steven D'Aprano wrote, even though the indentation is wrong) >>> >>> >>> >>> Doctesting anything to do with dictionaries is tricky, because you >>> cannot rely on the order of a dict. There are

Re: [Tutor] doctest question

2012-11-27 Thread Albert-Jan Roskam
  > On 27/11/12 08:06, Albert-Jan Roskam wrote: >> Hi, >> >> I am using doctest and I am struggling with newlines characters >> (see below). One is the newline escape (backslash) for a long >> dictionary definition. The other is an embedded \n in the output. >> I used the +NORMALIZE_WHITESPACE dir

Re: [Tutor] doctest question

2012-11-26 Thread Steven D'Aprano
On 27/11/12 09:02, Steven D'Aprano wrote: Here's my attempt: def _setMultRespDefsEx(multRespDefs): """Format a dictionary of stuff as a string. Expects that dict contains: [...] KNOWN BUGS: 1) Sometimes this function returns a dict instead of a string. 2) The formatted string output is amb

Re: [Tutor] doctest question

2012-11-26 Thread Steven D'Aprano
On 27/11/12 08:06, Albert-Jan Roskam wrote: Hi, I am using doctest and I am struggling with newlines characters (see below). One is the newline escape (backslash) for a long dictionary definition. The other is an embedded \n in the output. I used the +NORMALIZE_WHITESPACE directive. I also tried

[Tutor] doctest question

2012-11-26 Thread Albert-Jan Roskam
Hi, I am using doctest and I am struggling with newlines characters (see below). One is the newline escape (backslash) for a long dictionary definition. The other is an embedded \n in the output. I used the +NORMALIZE_WHITESPACE directive. I also tried using a triple-quoted raw docstring. Any id