[email protected] writes: >>>> x = [1, 2, 3] .. >>>> y > ['insertme', 1, 'insertme', 2, 'insertme', 3]
def ix(prefix, x):
for a in x:
yield prefix
yield a
y = list(ix('insertme', x))
================
from itertools import *
y = list(chain.from_iterable(izip(repeat('insertme'), x)))
================
etc.
--
http://mail.python.org/mailman/listinfo/python-list
