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

Raymond Hettinger vze4rx4y at verizon.net
Sat Apr 30 04:44:21 EDT 2005


[Bengt Richter]
> 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')

Log a feature request on SF and assignment to me.
I'll put this in for you.


Raymond Hettinger





More information about the Python-list mailing list