append to the end of a dictionary

Sion Arrowsmith siona at chiark.greenend.org.uk
Wed Jan 25 16:02:38 CET 2006


I wrote:
>orderedListOfTuples = [(k,v) for k,v in sorted(mydict.items())]
>
>(k, mydict[k]) sets off warning bells for me that mydict.items()
>should be in use [ ... ]

But apparently [ x for x in mylist ] doesn't yet trigger such a
warning.

-- 
\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