Author serhiy.storchaka
Recipients Arfrever, eli.bendersky, ezio.melotti, larry, mrabarnett, pitrou, python-dev, serhiy.storchaka, tim.peters
Date 2013-08-04.18:31:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375641098.52.0.926313515714.issue18647@psf.upfronthosting.co.za>
In-reply-to
Content
> Serhiy, I don't see the regexp '(?:.*$\n?)*' anywhere in doctest.py.  Are you talking about the _EXAMPLE_RE regexp?  That's the closest I see.

Yes, it is. In my previous message I answered Eli.

> If that's the case, the "nothing to repeat" error is incorrect:  _EXAMPLE_RE also contains a negative lookahead assertion '(?![ ]*$)' to ensure that the later '.*$\n?' part never tries to match an empty string.

Thank you for explanation. Unlucky the getwidth() method is not smart enough to detect that minimal length of matched string is not 0. We should made either the getwidth() method or the _simple() function (or both) more smart.

> A compromise may be to replace
> .*$\n?
> with
> .+$\n? | .*$\n

I'm sure similar patterns are used in third-party code. We shouldn't break them, therefore we should fix _simple()/getwidth().
History
Date User Action Args
2013-08-04 18:31:38serhiy.storchakasetrecipients: + serhiy.storchaka, tim.peters, pitrou, larry, ezio.melotti, mrabarnett, Arfrever, eli.bendersky, python-dev
2013-08-04 18:31:38serhiy.storchakasetmessageid: <1375641098.52.0.926313515714.issue18647@psf.upfronthosting.co.za>
2013-08-04 18:31:38serhiy.storchakalinkissue18647 messages
2013-08-04 18:31:38serhiy.storchakacreate