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

Bengt Richter bokr at oz.net
Sat Apr 30 16:50:45 EDT 2005


On Sat, 30 Apr 2005 08:44:21 GMT, "Raymond Hettinger" <vze4rx4y at verizon.net> wrote:

>[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.
>
Thanks. It has request ID # 1193128

Regards,
Bengt Richter



More information about the Python-list mailing list