Greg Ward wrote: > ... > > I would suggest sys.warnings be a dictionary. > > > > python -Wbad-return -Wlines-per-func=50 > > > > >>> print sys.warnings > > {'bad-return': None, 'lines-per-func': '50'} > > Makes sense -- true to warn (possibly giving some extra meaning to > "truth", as in this example), and false to not warn. Or maybe None to > not warn, not-None to warn. Of course, if there are only compile-time > warnings, then modifying sys.warnings will only affect future imports, > execs, evals, etc. Actually, I had intended *presence* in the dictionary to mean "enabled." I don't think we'd want to pre-populate the dict with all possible flags ahead of time, then check for each of them on the command line. (startup time!) However, if we "simply" parsed the command line, extracted all -W options and dropped them into the dict, then we're set. Cheers, -g -- Greg Stein, http://www.lyra.org/
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