File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2316,11 +2316,25 @@ expression support in the :mod:`re` module).
23162316 strings (of arbitrary lengths) or ``None ``. Character keys will then be
23172317 converted to ordinals.
23182318
2319+ For example:
2320+
2321+ .. doctest ::
2322+
2323+ >>> str .maketrans({' a' : ' A' , ' b' : ' Boo' , ' c' : None })
2324+ {97: 'A', 98: 'Boo', 99: None}
2325+
23192326 If there are two arguments, they must be strings of equal length, and in the
23202327 resulting dictionary, each character in *from * will be mapped to the character at
23212328 the same position in *to *. If there is a third argument, it must be a string,
23222329 whose characters will be mapped to ``None `` in the result.
23232330
2331+ For example:
2332+
2333+ .. doctest ::
2334+
2335+ >>> str .maketrans(' ab' , ' AB' , ' c' )
2336+ {97: 65, 98: 66, 99: None}
2337+
23242338
23252339.. method :: str.partition(sep, /)
23262340
You can’t perform that action at this time.
0 commit comments