Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
itertools.groupby の怠惰は必要ありません。リストを次のようにリストの辞書にグループ化したいだけです。
dict([(a, list(b)) for a,b in itertools.groupby(mylist, mykeyfunc)])
すでにこれを行う標準機能はありますか?
いいえ、これを行うための関数は標準ライブラリに含まれていません。
あなたが望むことをする1行の関数がすでにあるようです。これを使って。