[Python-Dev] Tricky way of of creating a generator via a comprehension expression (original) (raw)
Ivan Levkivskyi levkivskyi at gmail.com
Wed Nov 22 11:43:35 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 ]
Sorry, forgot some details in the second "definition":
try:
def __gen():
for i in range(3):
yield (yield i)
g = list(__gen())
finally:
del __gen
-- Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20171122/b495505d/attachment-0001.html>
- 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 ]