Changes by Meador Inge mead...@gmail.com:
--
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
___
___
Python-bugs-list
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net:
--
nosy: +danielsh
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
___
___
Changes by Brett Cannon br...@python.org:
--
nosy: -brett.cannon
versions: +Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
___
Changes by Brett Cannon br...@python.org:
--
versions: +Python 3.4 -Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
___
___
Changes by Ed Campbell drescampb...@gmail.com:
--
nosy: +esc24
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
___
___
Python-bugs-list
Terry J. Reedy tjre...@udel.edu added the comment:
#3267 did not expose endless loop possibility and was closed as won't fix.
Rather than reopen that and close this and move nosy list back, I added to nosy
list here.
--
nosy: +brett.cannon, erickt, terry.reedy
Georg Brandl ge...@python.org added the comment:
FWIW, the endless loop possibility is not of issue here, and is simply an
artifact of the specific generator function the OP uses.
--
___
Python tracker rep...@bugs.python.org
Georg Brandl ge...@python.org added the comment:
While the behavior is confusing, I don't think yield inside comprehensions
should be disallowed. Rather, the fact that comprehensions have their own
scope should be stated clearer.
--
nosy: +georg.brandl
Benjamin Peterson benja...@python.org added the comment:
I think I can probably fix it, but it's debatable whether it should be done,
since it'd make list comps more of quasi functions.
--
nosy: +benjamin.peterson
___
Python tracker
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
This discussion should probably be moved to python-dev. With tools like
Twisted's inlineDefer or the Monocle package, there is a growing need to be
able to use yield in complex expressions. Yet, that goes against the trend
Guido van Rossum gu...@python.org added the comment:
I think it is definitely wrong the way it works in 3.x. (Especially since it
works as expected in 2.x.)
I agree with Inyeol's preference of fixes: (1) make it work properly for
listcomps as well as genexps, (2) if that's not possible,
Guido van Rossum gu...@python.org added the comment:
PS. Wasn't there a similar issue with something inside a genexp that raises
StopIteration? Did we ever solve that?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
Changes by Guido van Rossum gu...@python.org:
--
assignee: gvanrossum -
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
___
___
Changes by Alexander Belopolsky belopol...@users.sourceforge.net:
--
nosy: +belopolsky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
___
___
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Isn't this the same issue as #3267?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
___
Guido van Rossum gu...@python.org added the comment:
Yes it is, but I was never asked about it back then.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10544
___
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Hmm, what an interesting and unexpected side-effect of the efforts to hide the
loop induction variable.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
no way to either stop the execution inside nested function
(since it's not started yet!) or send() a value to its yield expression. Still
I think this behavior is a bug and needs fixed.
- best fix would make it behave the same as for loop.
- if it's not fixable, yield expression inside genexp should
Georg Brandl ge...@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.)
Anyway, perhaps yield in lambdas should be forbidden.
Benjamin Peterson benja...@python.org added the comment:
On Sat, Dec 27, 2008 at 11:41 AM, Georg Brandl rep...@bugs.python.org wrote:
Georg Brandl ge...@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
Georg Brandl ge...@python.org added the comment:
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.
Benjamin Peterson benja...@python.org added the comment:
Fixed in r67954.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4748
___
1 (2)
7 YIELD_VALUE
8 BUILD_TUPLE 2
11 RETURN_VALUE
--
messages: 78291
nosy: georg.brandl
priority: high
severity: normal
status: open
title: yield expression vs lambda
versions: Python 2.6, Python 3.0
Benjamin Peterson benja...@python.org added the comment:
Attaching patch?
BTW, how did you find this bug? :)
--
keywords: +needs review, patch
nosy: +benjamin.peterson
stage: - patch review
type: - behavior
Added file: http://bugs.python.org/file12467/nasty_lambda_generators.patch
What if I say
oath= yield
or
other= yield
?
Does yield evaluate without parenthes? (Eth.)
--
http://mail.python.org/mailman/listinfo/python-list
En Mon, 21 Apr 2008 15:03:05 -0300, [EMAIL PROTECTED] escribió:
What if I say
oath= yield
or
other= yield
?
Does yield evaluate without parenthes? (Eth.)
You can't use yield except in a generator function. From
http://docs.python.org/ref/yieldexpr.html and the grammar definition
101 - 126 of 126 matches
Mail list logo