Tim Peters <t...@python.org> added the comment: Right, "..." immediately after a ">>>" line is taken to indicate a code continuation line, and there's no way to stop that short of rewriting the parser.
The workaround you already found could be made more palatable if you weren't determined to make it impenetrable ;-) For example, """ >>> print("not an ellipsis\\n" + res) #doctest:+ELLIPSIS not an ellipsis ... d41d8cd98f00b204e9800998ecf8427e __init__.py ... """ Or if this is a one-off, some suitable variant of this is simple: """ >>> "d41d8cd98f00b204e9800998ecf8427e __init__.py" in res True """ I'd prefer that, since it directly says you don't care about anything other than that `res` contains a specific substring (in the original way, that has to be _inferred_ from the pattern of ellipses). ---------- nosy: -steven.daprano type: enhancement -> behavior _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32509> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com