Last Updated: February 25, 2016
·
327
· mechmind

Prepare dict of lists

# get it
from itertools import product
storage = dict(product(list_of_keys, [[]]))

# use it
for item in items:
    storage[get_item_type(item)].append(item)