[Python-ideas] Making (?x) less scary

Ryan Gonzalez rymg19 at gmail.com
Fri Feb 12 11:15:40 EST 2016


I was reading re's docs and came across this:


Note that the (?x) flag changes how the expression is parsed. It should be used first in the expression string, or after one or more whitespace characters. If there are non-whitespace characters before the flag, the results are undefined.


Is there a particular reason for this being undefined? It seems kind of un-Pythonic to me and more like C/C++. Would it be possible to instead throw an exception, e.g. ValueError?
-- 
Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160212/d6f9bd86/attachment.html>


More information about the Python-ideas mailing list