Sion Arrowsmith wrote: > In article <[EMAIL PROTECTED]>, > Peter Otten <[EMAIL PROTECTED]> wrote: >>Terry Reedy wrote: >>> >>> 'abcde'.translate(str.maketrans('','','bcd')) >>> 'ae' >>You should mention that you are using Python 3.0 ;) >>The 2.5 equivalent would be >> >>>>> u"abcde".translate(dict.fromkeys(map(ord, u"bcd"))) >>u'ae' > > Only if you're using Unicode:
... which is what you do if you are using the str type in 3.0. Peter -- http://mail.python.org/mailman/listinfo/python-list