[issue4748] yield expression vs lambda

Benjamin Peterson report at bugs.python.org
Sat Dec 27 19:07:41 CET 2008


Benjamin Peterson <benjamin at python.org> added the comment:

On Sat, Dec 27, 2008 at 11:41 AM, Georg Brandl <report at bugs.python.org> wrote:
>
> Georg Brandl <georg at python.org> added the comment:
>
> I didn't find it, but someone from the German Python webforum. :)
>
> Hmm, I wonder why lambda: (yield 1) alone doesn't give [1, None]. (That
> should also go into the test case.)

Actually, I don't think the return value should even make it's way to
the list. Generator lambdas shouldn't have any return value IMO.

>
> Anyway, perhaps yield in lambdas should be forbidden.

Probably too late now for 2.x and 3.x.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4748>
_______________________________________


More information about the Python-bugs-list mailing list