Tim Peters
ad1a18b78e
Change the semantics of "return" in generators, as discussed on the
...
Iterators list and Python-Dev; e.g., these all pass now:
def g1():
try:
return
except:
yield 1
assert list(g1()) == []
def g2():
try:
return
finally:
yield 1
assert list(g2()) == [1]
def g3():
for i in range(3):
yield None
yield None
assert list(g3()) == [None] * 4
compile.c: compile_funcdef and com_return_stmt: Just van Rossum's patch
to compile the same code for "return" regardless of function type (this
goes back to the previous scheme of returning Py_None).
ceval.c: gen_iternext: take a return (but not a yield) of Py_None as
meaning the generator is exhausted.
2001-06-23 06:19:16 +00:00
..
2000-05-02 18:34:30 +00:00
2000-09-01 23:29:29 +00:00
2001-05-28 22:30:08 +00:00
2001-06-23 06:19:16 +00:00
2000-09-26 05:46:01 +00:00
2001-06-23 06:19:16 +00:00
2000-07-22 18:47:25 +00:00
2000-09-04 00:54:56 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2001-01-19 23:34:06 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2001-01-10 21:17:27 +00:00
2000-09-01 23:29:29 +00:00
2001-05-09 00:50:59 +00:00
2001-05-30 06:09:50 +00:00
2001-04-20 19:13:02 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2001-03-10 02:15:37 +00:00
2001-05-29 17:46:19 +00:00
2000-09-05 04:40:39 +00:00
2001-04-12 20:53:31 +00:00
2000-09-01 23:29:29 +00:00
2001-01-18 03:03:16 +00:00
2000-11-03 08:18:37 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2001-06-18 22:08:13 +00:00
2000-07-31 15:28:04 +00:00
2001-04-29 22:21:25 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2001-06-18 22:08:13 +00:00
2000-09-01 23:29:29 +00:00
2001-03-12 21:03:26 +00:00
2000-09-01 23:29:29 +00:00
2000-07-22 18:47:25 +00:00
2001-01-23 01:46:06 +00:00
2001-06-13 17:18:06 +00:00
2000-09-01 23:29:29 +00:00
2000-07-22 18:47:25 +00:00
2000-09-01 23:29:29 +00:00
2000-07-22 18:47:25 +00:00
2001-01-27 06:20:08 +00:00
2001-06-18 22:08:13 +00:00
2001-06-16 21:02:31 +00:00
2000-09-01 23:29:29 +00:00
2000-11-13 19:45:45 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2000-10-12 20:58:32 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2000-09-01 23:29:29 +00:00
2000-10-06 15:48:38 +00:00
2000-09-01 23:29:29 +00:00