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



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
.



Relevant Pages