This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bskinn
Recipients bskinn, paul.moore
Date 2019-08-09.18:06:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565373985.6.0.472537969395.issue36714@roundup.psfhosted.org>
In-reply-to
Content
Mm, agreed--that regex wouldn't be hard to write.

The problem is, AFAICT there's irresolvable syntactic ambiguity in a line starting with exactly three periods, if the doctest PS2 specification is not constrained to be exactly "... ". In such a case, "..." could mark either (1) an ellipsis standing in for an entire line of 'want', or (2) a PS2, marking a blank line in 'source'.

I don't really think aggressive lookahead would help much -- an arbitrary number of following lines could contain exactly "...", and the intended transition from 'source' to 'want' could lie at any one of them.  The nonrecursive nature of regex is unhelpful here, but I don't think one could even write a recursive-descent parser, or similar, that could be 100% reliable on a single comparison. It would have to test the string against all the various splits between 'source' and 'want' along those "..." lines, and see if any match. Hairy mess.

AFAICT, defining "... " as PS2, and "..." as 'ellipsis representing a whole line' is the cleanest solution from a logical point of view.

Of course, then it's *visually* confusing, because trailing space. ¯\_(ツ)_/¯
History
Date User Action Args
2019-08-09 18:06:25bskinnsetrecipients: + bskinn, paul.moore
2019-08-09 18:06:25bskinnsetmessageid: <1565373985.6.0.472537969395.issue36714@roundup.psfhosted.org>
2019-08-09 18:06:25bskinnlinkissue36714 messages
2019-08-09 18:06:25bskinncreate