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.

classification
Title: "...." (four dots) confuses doctest's ellipsis matching
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: spiv, tim.peters
Priority: normal Keywords:

Created on 2006-06-19 11:42 by spiv, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg28835 - (view) Author: Andrew Bennetts (spiv) Date: 2006-06-19 11:42
Consider this snippet:

from doctest import OutputChecker, ELLIPSIS
print OutputChecker().check_output('AAA....',
'AAA.BBB', ELLIPSIS)

I expect that to print True, but instead it prints False.
msg28836 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2006-06-19 12:20
Logged In: YES 
user_id=31435

Sorry, but this won't change.  As in most simple parsers, a
"maximal munch" rule is at work for recognizing
multi-character tokens:  your pattern gets parsed as

    "AAA" <ellipsis> "."

not as

    "AAA." <ellipsis>

or as

    "AAA...."

Therefore it matches all and only those strings that begin
with "AAA" and end with ".".

The maximal-munch rules gives an easy-to-predict way of
resolving ambiguous inputs, but you're stuck with the way it
 picks.  Because of this, there is no direct way to use
ELLIPSIS to get the effect I'm guessing you want (i.e., I'm
guessing you want it parsed as

    "AAA." <ellipsis>

).
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43522
2006-06-19 11:42:27spivcreate