Index: Python/compile.c =================================================================== --- Python/compile.c (revision 67926) +++ Python/compile.c (working copy) @@ -1534,7 +1534,12 @@ c->u->u_argcount = asdl_seq_LEN(args->args); VISIT_IN_SCOPE(c, expr, e->v.Lambda.body); - ADDOP_IN_SCOPE(c, RETURN_VALUE); + if (c->u->u_ste->ste_generator) { + ADDOP_IN_SCOPE(c, POP_TOP); + } + else { + ADDOP_IN_SCOPE(c, RETURN_VALUE); + } co = assemble(c, 1); compiler_exit_scope(c); if (co == NULL) Index: Lib/test/test_generators.py =================================================================== --- Lib/test/test_generators.py (revision 67926) +++ Lib/test/test_generators.py (working copy) @@ -928,6 +928,12 @@ 'f' >>> repr(g) # doctest: +ELLIPSIS '' + +Lambdas shouldn't have their usual return behavior. + +>>> x = lambda: ((yield 1), (yield 2)) +>>> list(x()) +[1, 2] """ # conjoin is a simple backtracking generator, named in honor of Icon's