Brian Skinn <bsk...@alum.mit.edu> added the comment:

I suppose one alternative solution might be to tweak the ELLIPSIS feature of 
doctest, such that it would interpret a run of >=3 periods in a row (matching 
regex pattern of "[.]{3,}") as 'ellipsis'.

The regex for PS2 could then have a negative lookahead added, so that it *only* 
matches three periods, plus optionally other content: '\.\.\.(?!\.)'

That way, a line like "... foo" would retain the current meaning of "'source' 
line, consisting of PS2 plus the identifier 'foo'", but the meaning of 
"arbitrary content followed by ' foo'" could be achieved by ".... foo", since 
the leading "...." would NOT match the negative lookahead for PS2.

In other situations, where "..." is *not* the leading non-whitespace content, 
the old behavior suffices: the PS2 regex won't match anyways, so it'll be left 
for ELLIPSIS to process.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36714>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to