[issue24650] Error in yield expression documentation

2022-01-07 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue24650] Error in yield expression documentation

2022-01-07 Thread miss-islington
miss-islington added the comment: New changeset 75a1865d1ce352909ad9a30d001486bbd7d3ed75 by Miss Islington (bot) in branch '3.10': [3.10] bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663) (GH-30461)

[issue24650] Error in yield expression documentation

2022-01-07 Thread miss-islington
miss-islington added the comment: New changeset 8bc68140cbe8230cf048bc04faf927c1413066d1 by Miss Islington (bot) in branch '3.9': bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663)

[issue24650] Error in yield expression documentation

2022-01-07 Thread Irit Katriel
Irit Katriel added the comment: New changeset 273cb8e7577d143830404f6779946a0bedb58758 by Jacob Walls in branch 'main': bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663) https://github.com/python/cpython/commit/273cb8e7577d143830404f6779946a0bedb58758

[issue24650] Error in yield expression documentation

2022-01-07 Thread miss-islington
Change by miss-islington : -- pull_requests: +28665 pull_request: https://github.com/python/cpython/pull/30462 ___ Python tracker ___

[issue24650] Error in yield expression documentation

2022-01-07 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28664 pull_request: https://github.com/python/cpython/pull/30461 ___ Python tracker

[issue24650] Error in yield expression documentation

2022-01-07 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue24650] Error in yield expression documentation

2021-02-27 Thread Jacob Walls
Change by Jacob Walls : -- keywords: +patch nosy: +jacobtylerwalls nosy_count: 4.0 -> 5.0 pull_requests: +23449 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/24663 ___ Python tracker

[issue24650] Error in yield expression documentation

2021-01-12 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +easy versions: +Python 3.10 -Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker ___

[issue10544] yield expression inside generator expression does nothing

2018-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 07ca9afaa8768b44baf816b4998d209ed3e0088f by Serhiy Storchaka in branch 'master': bpo-10544: Disallow "yield" in comprehensions and generator expressions. (GH-4564)

[issue10544] yield expression inside generator expression does nothing

2017-12-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- status: open -> closed ___ Python tracker ___

[issue10544] yield expression inside generator expression does nothing

2017-12-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 65d1887170fb278c10a836e9e4319cae4707f524 by Serhiy Storchaka in branch '2.7': [2.7] bpo-10544: Deprecate "yield" in comprehensions and generator expressions in Py3k mode. (GH-4579) (#4676)

[issue10544] yield expression inside generator expression does nothing

2017-12-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 4676 backports warnings to 2.7 in Py3k mode. -- status: closed -> open ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-12-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4584 ___ Python tracker ___ ___

[issue10544] yield expression inside generator expression does nothing

2017-11-30 Thread Nick Coghlan
Nick Coghlan added the comment: With Serhiy's patch merged, I'm marking this as resolved. Thanks all! https://bugs.python.org/issue32189 is the follow-up issue to turn the warning into an unconditional SyntaxError in 3.8. -- resolution: -> fixed stage: patch

[issue10544] yield expression inside generator expression does nothing

2017-11-30 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 73a7e9b10b2ec9636e3c6396cf7b3695f8ed1856 by Nick Coghlan (Serhiy Storchaka) in branch 'master': bpo-10544: Deprecate "yield" in comprehensions and generator expressions. (GH-4579)

[issue10544] yield expression inside generator expression does nothing

2017-11-27 Thread Guido van Rossum
Guido van Rossum added the comment: OK, great. -- ___ Python tracker ___ ___

[issue10544] yield expression inside generator expression does nothing

2017-11-27 Thread Nick Coghlan
Nick Coghlan added the comment: As far as I'm aware, there's nothing that specifically promises these constructs will do anything in Py3 at all - the existing behaviour is just an accident of implementation arising from the way nested scopes and yield expressions interact

[issue10544] yield expression inside generator expression does nothing

2017-11-27 Thread Guido van Rossum
Guido van Rossum added the comment: After the tiresome debate I am happy to see this just as a "what's new" entry rather than soliciting more debate with a PEP. (However there may be some existing PEP that suggests it should work? That PEP should be amended with a note that

[issue10544] yield expression inside generator expression does nothing

2017-11-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that the DeprecationWarning exception is replaced with a SyntaxError to get a more accurate error report. $ cat yield-gen.py def f(): return ((yield x) for x in range(3)) $ ./python -Wd yield-gen.py yield-gen.py:2:

[issue10544] yield expression inside generator expression does nothing

2017-11-27 Thread Nick Coghlan
Nick Coghlan added the comment: Guido, should we write this change up as a PEP, or are you happy to just cover it as a section in the What's New document for 3.7? -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4506 ___ Python tracker ___ ___

[issue10544] yield expression inside generator expression does nothing

2017-11-26 Thread Guido van Rossum
Guido van Rossum added the comment: Great. It should be a DeprecationWarning, since we're planning to disallow it completely, right? IIRC SyntaxWarning is for syntax that we can't deprecate. -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-26 Thread Nick Coghlan
Nick Coghlan added the comment: Cool, if you're OK with that behaviour, it actually makes this a lot easier, since it means: 1. Serhiy's patch is already sufficient for the final hard compatibility break 2. It can be readily adapted to emit either DeprecationWarning or

[issue10544] yield expression inside generator expression does nothing

2017-11-26 Thread Guido van Rossum
don't want to expose that detail to end users, > > and will instead want to include a second check that prohibits yield > > expressions in the outermost iterator as well. However, I'm not entirely > > sure how we could implement such a check, short of adding a new "yield

[issue10544] yield expression inside generator expression does nothing

2017-11-25 Thread Guido van Rossum
t to expose that detail to end users, > and will instead want to include a second check that prohibits yield > expressions in the outermost iterator as well. However, I'm not entirely > sure how we could implement such a check, short of adding a

[issue10544] yield expression inside generator expression does nothing

2017-11-25 Thread Nick Coghlan
hort of adding a new "yield expression prohibited" counter in the AST generation and/or symbol analysis pass. -- ___ Python tracker <rep...@bugs.python.org>

[issue10544] yield expression inside generator expression does nothing

2017-11-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4492 stage: needs patch -> patch review ___ Python tracker ___

[issue10544] yield expression inside generator expression does nothing

2017-11-25 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: -levkivskyi ___ Python tracker ___ ___

[issue10544] yield expression inside generator expression does nothing

2017-11-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a sample of the implementation of the Nick's idea. -- keywords: +patch Added file: https://bugs.python.org/file47296/yield-in-comprehensions.diff ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-25 Thread Guido van Rossum
Guido van Rossum added the comment: No to both. See python-dev. -- ___ Python tracker ___

[issue10544] yield expression inside generator expression does nothing

2017-11-24 Thread Nick Coghlan
Nick Coghlan added the comment: I realised that even without modifying the compiler first, I could illustrate the proposed `yield from` based resolution for the comprehension case by way of explicit yield from clauses: ``` def get_gen_result(gen, inputs): try:

[issue10544] yield expression inside generator expression does nothing

2017-11-24 Thread Nick Coghlan
Nick Coghlan <ncogh...@gmail.com> added the comment: Given the direction of the python-dev thread, should we split this question into two issues? Issue 1: a yield expression inside a comprehension changes the type of the expression result (returning a generator-iterator i

[issue10544] yield expression inside generator expression does nothing

2017-11-24 Thread Armin Rigo
Change by Armin Rigo : -- nosy: -arigo ___ Python tracker ___ ___

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > How about not posting about this topic for 24 hours. OK, makes sense :-) -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Guido van Rossum
Guido van Rossum added the comment: I think we all need to calm down a bit. How about not posting about this topic for 24 hours. -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Guido, I am not sure about the complete removal, this is probably to radical. What I think we are missing more detailed docs that would be clear about the corner cases. (I already mentioned this in https://bugs.python.org/issue32113)

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury OK, sorry then this is a misunderstanding from my side. NP. Again, sorry if I sounded that way to you. -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yury OK, sorry then this is a misunderstanding from my side. -- ___ Python tracker ___

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: >> Do you understand the difference? > Yury, sorry, but what is your problem? Have I said something about that this > is bad. Your tone is clearly insulting, and this is not the first time. Maybe > it makes sense to have some respect?

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Do you understand the difference? Yury, sorry, but what is your problem? Have I said something about that this is bad. Your tone is clearly insulting, and this is not the first time. Maybe it makes sense to have some respect?

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: > Well, after all I am thinking maybe it is indeed makes sense to ban `yield` > inside both sync/async and both comprehensions/generator expressions. I agree, as I can't imagine a real use case for a = ((yield a) for a in as) which

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Guido van Rossum
Guido van Rossum added the comment: I honestly think we went too far here. Asynchronous generators are still provisional. Though the PEP is silent about this, the acceptance notice is clear: https://mail.python.org/pipermail/python-dev/2016-September/146267.html. I propose to

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Well, after all I am thinking maybe it is indeed makes sense to ban `yield` inside both sync/async and both comprehensions/generator expressions. Since we already have a smörgåsbord of intuitive behaviors. This, _together_ with

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: > ... but [await x for x in xs] is still valid _only_ inside async def. Yes, because it's computed right where it is defined. a = [x for x in xs] # `a` is a list object a = (x for x in xs) # `a` is a generator Do you understand the

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: ... but [await x for x in xs] is still valid _only_ inside async def. -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: It's also important to note, that in 3.7, this is legal: def foo(): return (await x for x in xs) Note that 'foo' is a regular function, not 'async def'. -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury explained why this happens in https://bugs.python.org/issue32113 It happens because '(x for x in xs)' creates a synchronous generator. So when there's an 'await' in it, it creates an asynchronous generator. --

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: (Of course there should be not [1, 2] in the argument, but a list of some awaitables, otherwise there will be an error later.) -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Remind me what happens when you use `await` in a generator expression that > survives the async function's scope? Awaiting on f([1, 2]) will result in an async generator (even though yield never appears here). Yury explained why this

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Guido van Rossum
Guido van Rossum added the comment: Remind me what happens when you use `await` in a generator expression that survives the async function's scope? async def f(xs): return (await x for x in xs) -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Ivan. It would be nice to me to disallow "yield" in comprehensions and generator expressions, but the fact that "await" in comprehensions already works right, and this behavior is intentional and useful, make me

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Consider this as a sort of optimization. A function inlining. In general case we can't inline a function because it can be rebinded at any time, but in this particular case we call a just created function that doesn't have any

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Nick, > Yury took all this into account when designing the interaction between > `await` and comprehensions (which is why that's in a better state), but for > `yield` we inherited the existing behaviour of any other nested function.

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is straightforward. __result = []; __i = None try: for __i in range(2, 5): __result2 = []; __x = __y = None try: for __x in range(2): for __y in range(1, __i):

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Nick Coghlan
Nick Coghlan added the comment: Sure, you can technically do that, but you'll have to rewrite most of the symtable pass in the compiler, since you won't be able to re-use the current recursive descent algorithms (which are designed to handle function scopes). That ran

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Nick Coghlan
Nick Coghlan added the comment: Another slight variant to that test case to make sure the inner comprehension actually generates a closure reference in the current implementation: >>> [[x+y for x in range(2) for y in range(1, i)] for i in range(2, 5)] [[1, 2], [1,

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I see nothing special in `[[x for x in range(1, i)] for i in range(2, 5)]`. This should be equivalent to: __result = []; __i = None try: for __i in range(2, 5): __result2 = []; __x = None try: for

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Nick Coghlan
Nick Coghlan added the comment: Also see https://bugs.python.org/issue1660500 for the original Python 3.0 change to hide the iteration variable. While the test suite already covers some interesting scoping edge cases as result of that initial patch, I think one we're

[issue10544] yield expression inside generator expression does nothing

2017-11-22 Thread Nick Coghlan
Nick Coghlan added the comment: "Just fix the issue" is easier said than done for the same reason that comprehensions were implemented the way they are now: lambda expressions still have to work. That is, we need to maintain the invariant that: [x for x in iterable]

[issue10544] yield expression inside generator expression does nothing

2017-11-22 Thread Nick Coghlan
Change by Nick Coghlan : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list

[issue10544] yield expression inside generator expression does nothing

2017-11-22 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- assignee: levkivskyi -> ___ Python tracker ___ ___

[issue10544] yield expression inside generator expression does nothing

2017-11-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka versions: +Python 3.6, Python 3.7 -Python 3.5 ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-07-20 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- assignee: -> levkivskyi ___ Python tracker ___ ___

[issue10544] yield expression inside generator expression does nothing

2017-07-20 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___

[issue10544] yield expression inside generator expression does nothing

2017-01-28 Thread Armin Rigo
Armin Rigo added the comment: Let's see if the discussion goes anywhere or if this issue remains in limbo for the next 7 years. In the meantime, if I may humbly make a suggestion: whether the final decision is to give SyntaxError or change the semantics, one or a few intermediate versions

[issue10544] yield expression inside generator expression does nothing

2017-01-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > How about fixing CPython to raise SyntaxWarning or even SyntaxError? I think it is better to just fix the issue, i.e. make comprehensions be equivalent to for-loops even if they contain `yield`. (In particular this will lead to [(yield i) for i in

[issue10544] yield expression inside generator expression does nothing

2017-01-28 Thread Armin Rigo
Armin Rigo added the comment: Just to add my comment to this 7-years-old never-resolved issue: in PyPy 3.5, which behaves like Python 3.x in this respect, I made the following constructions give a warning. def wrong_listcomp(): return [(yield 42) for i in j] def

[issue10544] yield expression inside generator expression does nothing

2017-01-25 Thread Glyph Lefkowitz
Glyph Lefkowitz added the comment: OK, cool. So, long term, there will be a way to do this (suspend within a generator expression). Thanks for the pointer. -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-01-25 Thread Glyph Lefkowitz
Glyph Lefkowitz added the comment: (As far as awaiting on int, yes, I know how await works, I was focusing on the syntax.) -- ___ Python tracker ___

[issue10544] yield expression inside generator expression does nothing

2017-01-25 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Python 3.5 does not support this, you should use Python 3.6 (plus await x will fail when you will run the coroutine, since you cannot await on int). -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-01-25 Thread Glyph Lefkowitz
Glyph Lefkowitz added the comment: >>> async def foo(): ... bar = [await x for x in range(10)] File "", line 2 SyntaxError: 'await' expressions in comprehensions are not supported -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-01-25 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Is the fact that 'await' produces a syntax error in this context the same bug > or a new one? What kind of SyntaxError? await outside an async function is prohibited, bare await is also prohibited. -- ___

[issue10544] yield expression inside generator expression does nothing

2017-01-25 Thread Glyph Lefkowitz
Glyph Lefkowitz added the comment: Is the fact that 'await' produces a syntax error in this context the same bug or a new one? -- nosy: +glyph ___ Python tracker

[issue24650] Error in yield expression documentation

2015-07-17 Thread swanson
New submission from swanson: https://docs.python.org/3/reference/expressions.html in 6.2.9. Yield expressions end of 1st paragraph: Using a yield expression in a function’s body causes that function to be a generator. NO! As the very next sentence explains, a generator is what's returned

[issue24650] Error in yield expression documentation

2015-07-17 Thread swanson
swanson added the comment: Okay, interesting - I hadn't checked the glossary. I don't ultimately care what it's called as long as the documentation is clear and consistent. But for anyone just looking at the names of the classes and the class hierarchy, they'd come away saying, A generator

[issue24650] Error in yield expression documentation

2015-07-17 Thread Martin Panter
Martin Panter added the comment: Technically, the glossary defines the unqualified term “generator” as the factory function: https://docs.python.org/3.5/glossary.html#term-generator. (The 3.6 documentation should say the same but the build has been broken or out of date for a few months.)

[issue24088] yield expression confusion

2015-05-05 Thread Guido van Rossum
Changes by Guido van Rossum gu...@python.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24088 ___

[issue24088] yield expression confusion

2015-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6e59d82d3d09 by Guido van Rossum in branch 'default': Issue 24088: Clarify semantics of yield expression (merge from 3.4). https://hg.python.org/cpython/rev/6e59d82d3d09 -- ___ Python tracker rep

[issue24088] yield expression confusion

2015-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset b87d96e0708e by Guido van Rossum in branch '3.4': Issue 24088: Clarify semantics of yield expression. https://hg.python.org/cpython/rev/b87d96e0708e -- nosy: +python-dev ___ Python tracker rep

[issue24088] yield expression confusion

2015-05-04 Thread Jim Jewett
Jim Jewett added the comment: OK, then how about Current: When a generator function is called, it returns an iterator known as a generator. That generator then controls the execution of a generator function. The execution starts when one of the generator’s methods is called. Proposed:

[issue24088] yield expression confusion

2015-05-04 Thread R. David Murray
R. David Murray added the comment: I don't think anything about frames is guaranteed as part of the language, so I'm not sure that mention of it belongs in the description. Personally, I find your reformulation more confusing that the original with 'a' replaced by 'the'. --

[issue24088] yield expression confusion

2015-05-01 Thread R. David Murray
R. David Murray added the comment: Yes, and it is not using generator function in two different ways: it is literally the case that calling the generator function returns a generator object, which in turn controls the execution of the generator function. The text then goes on to explain how

[issue10544] yield expression inside generator expression does nothing

2015-04-30 Thread A. Jesse Jiryu Davis
Changes by A. Jesse Jiryu Davis je...@emptysquare.net: -- nosy: +emptysquare ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10544 ___ ___

[issue24088] yield expression confusion

2015-04-30 Thread Guido van Rossum
Guido van Rossum added the comment: You can't just drop the middle sentence. Awkward though it is, it is attempting to describe that the generator object controls suspension and resumption of the stack frame representing execution of the generator function's body. --

[issue24088] yield expression confusion

2015-04-30 Thread Jim Jewett
of the generator’s methods is called. -- assignee: docs@python components: Documentation, asyncio messages: 242289 nosy: Jim.Jewett, docs@python, gvanrossum, haypo, yselivanov priority: normal severity: normal status: open title: yield expression confusion type: enhancement

[issue10544] yield expression inside generator expression does nothing

2015-04-18 Thread levkivskyi
levkivskyi added the comment: I would like to add that since the introduction of asyncio module that heavily uses yield from syntax, binding of yield inside comprehensions/generator expressions could lead to unexpected results/confusing behavior. See for example this question on SO:

[issue10544] yield expression inside generator expression does nothing

2014-01-31 Thread Yury Selivanov
Changes by Yury Selivanov yselivanov...@gmail.com: -- versions: +Python 3.5 -Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10544 ___

[issue10544] yield expression inside generator expression does nothing

2013-11-04 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: -terry.reedy versions: -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10544 ___

Re: yield expression

2013-02-26 Thread Colin J. Williams
On 24/02/2013 7:36 PM, Ziliang Chen wrote: Hi folks, When I am trying to understand yield expression in Python2.6, I did the following coding. I have difficulty understanding why val will be None ? What's happening under the hood? It seems to me very time the counter resumes to execute

Re: yield expression

2013-02-26 Thread Ian Kelly
On Tue, Feb 26, 2013 at 9:34 AM, Colin J. Williams c...@ncf.ca wrote: Perhaps it's becaoue (teild count) is a statement. Statements do not return a value. yield is a bit of an odd duck in that it's both a statement and an expression. Compare:

Re: yield expression

2013-02-26 Thread Dave Angel
On 02/26/2013 11:34 AM, Colin J. Williams wrote: On 24/02/2013 7:36 PM, Ziliang Chen wrote: Hi folks, When I am trying to understand yield expression in Python2.6, I did the following coding. I have difficulty understanding why val will be None ? What's happening under the hood? It seems to me

Re: yield expression

2013-02-26 Thread Vytas D.
)) if __name__ == '__main__': main() Hope helps. Vytas D. On Tue, Feb 26, 2013 at 4:34 PM, Colin J. Williams c...@ncf.ca wrote: On 24/02/2013 7:36 PM, Ziliang Chen wrote: Hi folks, When I am trying to understand yield expression in Python2.6, I did the following coding. I have difficulty

Re: yield expression

2013-02-26 Thread Colin J. Williams
to understand yield expression in Python2.6, I did the following coding. I have difficulty understanding why val will be None ? What's happening under the hood? It seems to me very time the counter resumes to execute, it will assign count to val, so val should NOT be None

Re: yield expression

2013-02-26 Thread Dave Angel
: Hi folks, When I am trying to understand yield expression in Python2.6, I did the following coding. I have difficulty understanding why val will be None ? What's happening under the hood? It seems to me very time the counter resumes to execute, it will assign

yield expression

2013-02-24 Thread Ziliang Chen
Hi folks, When I am trying to understand yield expression in Python2.6, I did the following coding. I have difficulty understanding why val will be None ? What's happening under the hood? It seems to me very time the counter resumes to execute, it will assign count to val, so val should

yield expression

2013-02-24 Thread Ziliang Chen
Hi folks, When I am trying to understand yield expression in Python2.6, I did the following coding. I have difficulty understanding why val will be None ? What's happening under the hood? It seems to me very time the counter resumes to execute, it will assign count to val, so val should

Re: yield expression

2013-02-24 Thread Oscar Benjamin
On 25 February 2013 00:39, Ziliang Chen zlchen@gmail.com wrote: Hi folks, When I am trying to understand yield expression in Python2.6, I did the following coding. I have difficulty understanding why val will be None ? What's happening under the hood? It seems to me very time the counter

yield expression

2013-02-24 Thread Ziliang Chen
Hi folks, When I am trying to understand yield expression in Python2.6, I did the following coding. I have difficulty understanding why val will be None ? What's happening under the hood? It seems to me very time the counter resumes to execute, it will assign count to val, so val should

Re: yield expression

2013-02-24 Thread Ziliang Chen
On Monday, February 25, 2013 8:51:28 AM UTC+8, Oscar Benjamin wrote: On 25 February 2013 00:39, Ziliang Chen wrote: Hi folks, When I am trying to understand yield expression in Python2.6, I did the following coding. I have difficulty understanding why val will be None ? What's

  1   2   >