]> granicus.if.org Git - python/commitdiff
Improved docstrings for str and unicode methods format and __format__.
authorEric Smith <eric@trueblade.com>
Sat, 6 Nov 2010 19:43:44 +0000 (19:43 +0000)
committerEric Smith <eric@trueblade.com>
Sat, 6 Nov 2010 19:43:44 +0000 (19:43 +0000)
Objects/stringobject.c
Objects/unicodeobject.c

index 347f3183381aa868d02088d958563c033b1214d2..6d3ca8eb82d782b0d0756be7f020419447f28dc0 100644 (file)
@@ -3582,7 +3582,8 @@ string_getnewargs(PyStringObject *v)
 PyDoc_STRVAR(format__doc__,
 "S.format(*args, **kwargs) -> string\n\
 \n\
-");
+Return a formatted version of S, using substitutions from args and kwargs.\n\
+The substitutions are identified by braces ('{' and '}').");
 
 static PyObject *
 string__format__(PyObject* self, PyObject* args)
@@ -3616,7 +3617,7 @@ done:
 PyDoc_STRVAR(p_format__doc__,
 "S.__format__(format_spec) -> string\n\
 \n\
-");
+Return a formatted version of S as described by format_spec.");
 
 
 static PyMethodDef
index 07b4e19795fb99a408c90f7d070bbcf35519b883..1cd3688fa5de652cd491df08c181af8214598684 100644 (file)
@@ -7728,7 +7728,8 @@ unicode_endswith(PyUnicodeObject *self,
 PyDoc_STRVAR(format__doc__,
              "S.format(*args, **kwargs) -> unicode\n\
 \n\
-");
+Return a formatted version of S, using substitutions from args and kwargs.\n\
+The substitutions are identified by braces ('{' and '}').");
 
 static PyObject *
 unicode__format__(PyObject *self, PyObject *args)
@@ -7762,7 +7763,7 @@ unicode__format__(PyObject *self, PyObject *args)
 PyDoc_STRVAR(p_format__doc__,
              "S.__format__(format_spec) -> unicode\n\
 \n\
-");
+Return a formatted version of S as described by format_spec.");
 
 static PyObject *
 unicode__sizeof__(PyUnicodeObject *v)