[Python-checkins] cpython (3.2): Fix str docstring

nick.coghlan python-checkins at python.org
Thu Aug 16 06:14:49 CEST 2012


http://hg.python.org/cpython/rev/8ff172a1b679
changeset:   78606:8ff172a1b679
branch:      3.2
parent:      78604:56dc7b09f390
user:        Nick Coghlan <ncoghlan at gmail.com>
date:        Thu Aug 16 14:13:07 2012 +1000
summary:
  Fix str docstring

files:
  Objects/unicodeobject.c |  12 ++++++++----
  1 files changed, 8 insertions(+), 4 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -9963,11 +9963,15 @@
 }
 
 PyDoc_STRVAR(unicode_doc,
-             "str(string[, encoding[, errors]]) -> str\n\
+             "str(object[, encoding[, errors]]) -> str\n\
 \n\
-Create a new string object from the given encoded string.\n\
-encoding defaults to the current default string encoding.\n\
-errors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'.");
+Create a new string object from the given object. If encoding or\n\
+errors is specified, then the object must expose a data buffer\n\
+that will be decoded using the given encoding and error handler.\n\
+Otherwise, returns the result of object.__str__() (if defined)\n\
+or repr(object).\n\
+encoding defaults to sys.getdefaultencoding().\n\
+errors defaults to 'strict'.");
 
 static PyObject *unicode_iter(PyObject *seq);
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list