New submission from Armin Rigo: Can you guess why importing the attached x.py does nothing, without printing "hello" at all?
The real issue shown in that example is that 'return' and 'yield' outside a function are ignored instead of giving a SyntaxError if they are optimized away by 'if 0:'. (Hint about x.py: the yield sets the CO_GENERATOR flag before it gets optimized away. So clearly, that's a way to comment out a whole module -- just put "if 0: yield" anywhere at top-level...) ---------- components: Interpreter Core files: x.py messages: 60213 nosy: arigo priority: low severity: minor status: open title: "if 0: return" not raising SyntaxError versions: Python 2.6 Added file: http://bugs.python.org/file9231/x.py __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1875> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com