mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Change the unicode.translate docstring to document that
Unicode strings (with arbitrary length) are allowed as entries in the unicode.translate mapping. Add a test case for multicharacter replacements. (Multicharacter replacements were enabled by the PEP 293 patch)
This commit is contained in:
parent
a04c3d86ae
commit
5c1ee17742
2 changed files with 5 additions and 2 deletions
|
@ -405,6 +405,8 @@ test('splitlines', u"\nabc\ndef\r\nghi\n\r", [u'\n', u'abc\n', u'def\r\n', u'ghi
|
|||
test('translate', u"abababc", u'bbbc', {ord('a'):None})
|
||||
test('translate', u"abababc", u'iiic', {ord('a'):None, ord('b'):ord('i')})
|
||||
test('translate', u"abababc", u'iiix', {ord('a'):None, ord('b'):ord('i'), ord('c'):u'x'})
|
||||
test('translate', u"abababc", u'<i><i><i>c', {ord('a'):None, ord('b'):u'<i>'})
|
||||
test('translate', u"abababc", u'c', {ord('a'):None, ord('b'):u''})
|
||||
|
||||
# Contains:
|
||||
print 'Testing Unicode contains method...',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue