martin v löwis qpnyslvloewisde id say clear two reasons one pretty much never use keys loop use dictionary ok consider items claim common use items iterate keys clearly behave items applications take snapshot keys rare right second dont think rare want process keys sorted order exactly common keys mydictkeys keyssort key keys indeed frequent case 2x fortunately david calls loud breakage py keys mydictkeys py keyssort traceback recent call last file line 1 attributeerror dict_keys object attribute sort fact 25 standard library turns 3 occurrences keyssort given thats ones used obvious name list sorted nowdays tend write keys sortedmydictkeys yeah know keys redundant key keys maybe key sortedmydict probably slower original version unless sorted switches insertion sort passed generator notice isnt affected spookiness dictkeys works fine think version slower behaves exactly original code list created keys list sorted listsort algorithm id say direct name use dictionary iterator directly dont think way dont think get right thing 2x 30 20 couldnt iterate dictionary also claim obvious iterating dictionary iterates keys useful convention obvious recall look year memorized explicit better implicit least aim obviousness case also common use items use explicitly common use iterate subject thread items anyway regards martin _______________________________________________ python3000 mailing list smsbmo9552pythonorg httpmailpythonorgmailmanlistinfopython3000 unsubscribe httpmailpythonorgmailmanoptionspython3000python300040tangomucom thu 07 aug 2008 071211 0200 python3000 spooky behavior dictitems friends