islice ってたぶん

def islice(gen, n):
  def wrap(n):
    i=0
    while i<n:
      yield gen.next()
      i += 1
  return wrap(n)

だけのことっぽい、