Shorter way to write list-as-dict-value in Python?
You can use collections.defaultdict:

from collections import defaultdict

mydict = defaultdict(list)


Now you just need:

mydict[color].append(path)


defaultdict is a subclass of dict that can be initialized to a list, integer...    



btw, the use of has_key is discouraged, and in fact has_key has been removed from  python 3.2.
When needed, use this by far more pythonic idiom instead:

if color in a:
    ........