Tim Peters added the comment:

I'm afraid it's just too tricky for the code to deduce that a negative 
lookahead assertion can imply that a later match can't be empty.  But I don't 
know how smart the re compilation code already is ;-)

It occurs to me now that the doctest regexp could worm around this very easily, 
via replacing:

.*$\n?

with:

.+$\n?

The success of the negative lookahead assertion here doesn't _just_ imply that


.*$\n?

will match a non-empty string, it also implies that

.+$

will succeed (and so also that .+$\n? will succeed).

----------

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

Reply via email to