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



On Sat, 30 Apr 2005 08:44:21 GMT, "Raymond Hettinger" <vze4rx4y@xxxxxxxxxxx> 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
.



Relevant Pages