Author arigo
Recipients arigo
Date 2008-01-19.18:55:48
SpamBayes Score 0.000458003
Marked as misclassified No
Message-id <1200768950.55.0.245752373825.issue1875@psf.upfronthosting.co.za>
In-reply-to
Content
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...)
History
Date User Action Args
2008-01-19 18:55:50arigosetspambayes_score: 0.000458003 -> 0.000458003
recipients: + arigo
2008-01-19 18:55:50arigosetspambayes_score: 0.000458003 -> 0.000458003
messageid: <1200768950.55.0.245752373825.issue1875@psf.upfronthosting.co.za>
2008-01-19 18:55:49arigolinkissue1875 messages
2008-01-19 18:55:49arigocreate