Another "if 0:" hack, this time to complain about otherwise invisible
"return expr" instances in generators (which latter may be generators
due to otherwise invisible "yield" stmts hiding in "if 0" blocks).
This was fun the first time, but this has gotten truly ugly now.
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index 3dd468b..7b78b2b 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -652,6 +652,17 @@
 [12, 666]
 
 >>> def f():
+...    yield
+Traceback (most recent call last):
+SyntaxError: invalid syntax
+
+>>> def f():
+...    if 0:
+...        yield
+Traceback (most recent call last):
+SyntaxError: invalid syntax
+
+>>> def f():
 ...     if 0:
 ...         yield 1
 >>> type(f())
@@ -704,6 +715,28 @@
 ...                 yield 2
 >>> type(f())
 <type 'None'>
+
+>>> def f():
+...     if 0:
+...         return
+...     if 0:
+...         yield 2
+>>> type(f())
+<type 'generator'>
+
+
+>>> def f():
+...     if 0:
+...         lambda x:  x        # shouldn't trigger here
+...         return              # or here
+...         def f(i):
+...             return 2*i      # or here
+...         if 0:
+...             return 3        # but *this* sucks (line 8)
+...     if 0:
+...         yield 2             # because it's a generator
+Traceback (most recent call last):
+SyntaxError: 'return' with argument inside generator (<string>, line 8)
 """
 
 __test__ = {"tut":      tutorial_tests,