Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r68998:ced0ef825679
Date: 2014-01-28 15:00 -0800
http://bitbucket.org/pypy/pypy/changeset/ced0ef825679/
Log: add maketrans' docs
diff --git a/pypy/objspace/std/unicodeobject.py
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -841,6 +841,20 @@
If chars is a str, it will be converted to unicode before stripping
"""
+ def maketrans():
+ """str.maketrans(x[, y[, z]]) -> dict (static method)
+
+ Return a translation table usable for str.translate(). If there
+ is only one argument, it must be a dictionary mapping Unicode
+ ordinals (integers) or characters to Unicode ordinals, strings
+ or None. Character keys will be then converted to ordinals. If
+ there are two arguments, they must be strings of equal length,
+ and in the resulting dictionary, each character in x will be
+ mapped to the character at the same position in y. If there is a
+ third argument, it must be a string, whose characters will be
+ mapped to None in the result.
+ """
+
def partition():
"""S.partition(sep) -> (head, sep, tail)
@@ -1114,7 +1128,8 @@
__getnewargs__ = interp2app(W_UnicodeObject.descr_getnewargs,
doc=UnicodeDocstrings.__getnewargs__.__doc__),
maketrans = interp2app(W_UnicodeObject.descr_maketrans,
- as_classmethod=True),
+ as_classmethod=True,
+ doc=UnicodeDocstrings.maketrans.__doc__),
)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit