yield all entries of an iterable

Sebastian sebastianspublicaddress at googlemail.com
Wed Oct 20 18:27:54 EDT 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