"Edward Loper" <edloper at gradient.cis.upenn.edu> wrote in message news:40BBF4C4.2090204 at gradient.cis.upenn.edu... > Tim Peters wrote: > > That's more what I had in mind, but if the marker is changed to something > > wordy instead of "a magic character", I don't think the dedent trick is of > > much value anymore: > > > > r""" > > A different marker: > > > > >>> print 'a\n\nb' > > a > > <blank line> > > b > > """ > > > > Then when the expected output is (exactly) "<blank line>", doctest would > > accept "<blank line>", or a line with nothing other than whitespace, as a > > match. I can't get upset by that bit of ambiguity. > > I had ruled this out because I assumed that any change I made had to > maintain backward compatibility. But if this (minor) incompatibility is > acceptable, then let me know and I'll write up a patch to implement it. To me as a potential user, '<blank line>' is the uniquely obvious marker for a blank line. The ambiguity is fine; having it uniquely not match itself and therefore needing a special case escape mechanism would be worse. I think the explanation "<blank line> matches a blank line as well as itself" might be sufficient. Terry J. Reedy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4