How do i generate a tuple from a generator ?
eye.zak.devel at gmail.com
Fri May 15 22:58:55 CEST 2009
I have a situation where i want a tuple from a generator/sequence
I am wondering, is this possible ? or is this just a bad idea all together?
__slots__ = ('__iters',)
assert len(args) != 0
self.__iters = tuple( __builtins__.iter(arg) for arg in args )
return [ i.next() for i in self.__iters ] # HERE I WANT A TUPLE
This can also be accomplished with a generator function, but requires
while True loop. is that better ?
More information about the Python-list