Bengt Richter <[EMAIL PROTECTED]> wrote: ... > Which is probably more efficient than one-liner updating the dict with > > mydict.update((k,'Null') for k,v in mydict.items() if v is None)
...which in turn is probably better than _auxd = {None: "Null"} newd = dict((k, _auxd.get(k, c) for k, c in mydict.items()) [which might be a nice idea if you wanted to do _several_ substitutions;-)...] Alex -- http://mail.python.org/mailman/listinfo/python-list