看板 Python 關於我們 聯絡資訊
請問 iteritems(), iterkeys(), itervalues() 效能會很好嗎? Dictionary 是個 mapping,他是如何支援 iterator? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.129.160.62
gasolin:for key, value in dict.items() 05/21 16:30
huggie:樓上這種的要做 list 效率應該會更差吧? 05/21 18:03
yungyuc:key, value 是個 tuple 05/22 22:06
huggie:但他們都放在 list 裡面阿 [(),()] 05/23 00:20
yungyuc:你沒有定義效能;list of tuple 的時間複雜度比較低 05/23 04:41
huggie:你的意思是時間複雜度比 iteritems() 低嗎? 05/23 15:52