>>    return string.translate(collections.defaultdict(lambda: None, **table))

Nice! I forgot about defautdict -- so this just needs a recipe somewhere -- maybe even in the docs for str.translate.

BTW, great use case for defautdict -- I had been wondering what the point was, given that a regular dict as .setdefault



Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception