Real-world use cases for map's None fill-in feature?

Raymond Hettinger python at rcn.com
Mon Jan 9 15:22:16 EST 2006


> Alternately, the need can be met with existing tools by pre-padding the
> iterator with enough extra values to fill any holes:
>
>     it = chain(iterable, repeat('', group_size-1))
>     result = izip_longest(*[it]*group_size)

Typo:  That should be izip() instead of izip_longest()




More information about the Python-list mailing list