I'm just a little surprised by this - Is there a reason why syntax warnings are special and untrappable via warnings.warn? >>> import warnings >>> def mywarn(*args): print 'xx', args ... >>> warnings.warn = mywarn >>> compile("def f():\n a = 1\n global a\n", "", "exec") :3: SyntaxWarning: name 'a' is assigned to before global declaration <code object <module> at 012DB410, file "", line 1> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20090601/1e0511ea/attachment.htm>
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