[Python-Dev] Tricky way of of creating a generator via a comprehension expression (original) (raw)
Ethan Furman ethan at stoneleaf.us
Thu Nov 23 10:37:39 EST 2017
- Previous message (by thread): [Python-Dev] Tricky way of of creating a generator via a comprehension expression
- Next message (by thread): [Python-Dev] Tricky way of of creating a generator via a comprehension expression
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 11/22/2017 11:51 PM, Sven R. Kunze wrote:
A "yield" within a comprehension is like a "return" in a comprehension. It makes no sense at all. Also a "yield" and a "return with value" is also rarely seen.
Comprehensions build new objects, they are not for control flow, IMO.
+1
--
Ethan
- Previous message (by thread): [Python-Dev] Tricky way of of creating a generator via a comprehension expression
- Next message (by thread): [Python-Dev] Tricky way of of creating a generator via a comprehension expression
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]