yield all entries of an iterable

Sebastian sebastianspublicaddress at googlemail.com
Thu Oct 21 00:27:54 CEST 2010


Hi,
Is there a simpler way to yield all elements of a sequence than this?
for x in xs:
    yield x

I tried googling but fond only the other direction (turning a generator
into a list with "list(my_generator())".

Sebastian





More information about the Python-list mailing list