[Newbie] List from a generator function

Sion Arrowsmith siona at chiark.greenend.org.uk
Mon Jul 24 07:44:06 EDT 2006


Paul Rubin  <http://phr.cx@NOSPAM.invalid> wrote:
> print list(islice(starmap(random.choice, repeat((possible_notes,))), length))

Why the use of starmap() rather than
imap(random.choice, repeat(possible_notes))
?

-- 
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump



More information about the Python-list mailing list