translate()

Jürgen Hermann jh at web.de
Fri Jun 29 17:20:00 EDT 2001


Hi!

I have some issues with string.translate() and want to hear some opinions:

1. The first argument (the translation table) always has to be provided. It
would be nice if I could pass in None to JUST delete some chars:
str.translate(None, "delchars")

2. string is deprecated, but there is no "maketrans" string method; a
possible implementation would be string.maketrans(a,b) ==> a.maketrans(b)

Any thoughts?

Ciao, Jürgen





More information about the Python-list mailing list