# -*- coding: utf-8 -*- import doctest def normalize(s): """ >>> normalize(u'á') u'b' """ return s.translate({ord(u'á'): u'b'}) doctest.testmod() print 'without doctest ===>>>', normalize(u'á')