> Fred> Guido van Rossum writes: > >> Agreed, but you're still using two levels of quoting, and with > >> anything less, "foo.bar" will also match a module named "foolbar". > > Fred> Agreed. "foo\.bar" will match "foolbar" as well, but 'foo\.bar' > Fred> only matches "foo.bar". > > Coming back to my original question, does it make sense to allow regular > expressions in the message and module fields in a -W command line arg? The > complexity of all the shell/re quoting suggests not, but having -W args > treated differently than the args to filterwarnings() doesn't seem right. > > Perhaps this is something that never happens in practice. I've never used > -W. Are there people out there who have used it and wished the message and > module fields could be regular expressions? Conversely, does anyone make > use of the fact that the message and module args to filterwarnings() can be > regular expressions? > > Looking through the Python source I see several examples of filterwarning() > where one or the other of the message and module args are regular > expressions, so that answers the second question. The first remains open. I'll call YAGNI on regexps for -W. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4