Wolfe Maykut wrote: > if prefixes.has_key(prefix): > prefixes[prefix].append(file) > else: > prefixes[prefix] = [] > prefixes[prefix].append(file) > > Is there a nicer way of doing this that I'm missing? How about: prefixes.setdefault(prefix, []).append(file) HTH, Robert Amesz