pep_tests = """
+Specification: Yield
+
+ Restriction: A generator cannot be resumed while it is actively
+ running:
+
+ >>> def g():
+ ... i = me.next()
+ ... yield i
+ >>> me = g()
+ >>> me.next()
+ Traceback (most recent call last):
+ ...
+ File "<string>", line 2, in g
+ ValueError: generator already executing
+
Specification: Return
Note that return isn't always equivalent to raising StopIteration: the
>>> list(g())
[1, 2, 3]
-A generator can't be resumed while it's already running.
-
->>> def g():
-... i = me.next()
-... yield i
->>> me = g()
->>> me.next()
-Traceback (most recent call last):
- ...
- File "<string>", line 2, in g
-ValueError: generator already executing
-
Next one was posted to c.l.py.
>>> def gcomb(x, k):