]> granicus.if.org Git - python/commitdiff
Add more inline documentation, as contributed in #487906.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 3 Dec 2001 08:24:52 +0000 (08:24 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 3 Dec 2001 08:24:52 +0000 (08:24 +0000)
Objects/stringobject.c

index 46bd99adb5aac63ff5edc6b203d93c430865b8ab..86e0ea725eb3c80b22799d7c6524d8498248c458 100644 (file)
@@ -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