Micro-PEP: str.translate(None) to mean identity translation

Bengt Richter bokr at oz.net
Fri Apr 29 21:37:20 EDT 2005


Just thought None as the first argument would be both handy and mnemonic,
signifying no translation, but allowing easy expression of deleting characters,
e.g.,

   s = s.translate(None, 'badcharshere')

Regards,
Bengt Richter



More information about the Python-list mailing list