summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-12-03 08:24:52 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-12-03 08:24:52 (GMT)
commit8f1ea71eab5538be1e0da8e2e40991dc62a6fbc5 (patch)
tree67786dcd2c3e90d2b70d165b820e70e3b4d8d64c /Objects/stringobject.c
parentb22c6720aae29ba8fbbf9133d89ba3938e305bbb (diff)
downloadcpython-8f1ea71eab5538be1e0da8e2e40991dc62a6fbc5.zip
cpython-8f1ea71eab5538be1e0da8e2e40991dc62a6fbc5.tar.gz
cpython-8f1ea71eab5538be1e0da8e2e40991dc62a6fbc5.tar.bz2
Add more inline documentation, as contributed in #487906.
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 46bd99a..86e0ea7 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -33,9 +33,14 @@ static PyStringObject *nullstring;
a NULL first argument, because in the future these routines may try to do
even more sharing of objects.
- The parameter `size' denotes number of characters to allocate, not counting
- the null terminating character. If the `str' argument is not NULL, then it
- must point to a null-terminated string of length `size'.
+ The string in the `str' parameter does not have to be null-character
+ terminated. (Therefore it is safe to construct a substring by using
+ `PyString_FromStringAndSize(origstring, substrlen)'.)
+
+ The parameter `size' denotes number of characters to allocate, not
+ counting the null terminating character. If the `str' argument is
+ not NULL, then it points to a of length `size'. For
+ PyString_FromString, this string must be null-terminated.
The member `op->ob_size' denotes the number of bytes of data in the string,
not counting the null terminating character, and is therefore equal to the