[Patches] [ python-Patches-487906 ] update inline docs in stringobject.c
noreply@sourceforge.net
noreply@sourceforge.net
Sun, 02 Dec 2001 08:47:16 -0800
Patches item #487906, was opened at 2001-12-01 12:42
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=487906&group_id=5470
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Zooko Ozoko (zooko)
Assigned to: Nobody/Anonymous (nobody)
Summary: update inline docs in stringobject.c
Initial Comment:
--- Objects/stringobject.c 2001/11/28 20:27:42
2.141
+++ Objects/stringobject.c 2001/12/01 20:40:09
@@ -19,19 +19,26 @@
#endif
/*
- Newsizedstringobject() and newstringobject() try in
certain cases
+ PyString_FromStringAndSize() and
PyString_FromString() try in certain cases
to share string objects. When the size of the
string is zero,
these routines always return a pointer to the same
string object;
when the size is one, they return a pointer to an
already existing
object if the contents of the string is known. For
- newstringobject() this is always the case, for
- newsizedstringobject() this is the case when the
first argument in
+ PyString_FromString() this is always the case, for
+ PyString_FromStringAndSize() this is the case when
the first argument in
not NULL.
- A common practice to allocate a string and then
fill it in or
- change it must be done carefully. It is only
allowed to change the
- contents of the string if the obect was gotten from
- newsizedstringobject() with a NULL first argument,
because in the
+ A common practice of allocating a string and then
filling it in or
+ changing it must be done carefully. It is only
allowed to change the
+ contents of the string if the object was gotten from
+ PyString_FromStringAndSize() with 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
in the string, not number
+ of bytes requires to store it, and does not count
the null terminating
+ character.
+
+ On the other hand, the member `op->ob_size' denotes
the number of bytes
+ used for storing the string, including the null
terminating character.
*/
PyObject *
PyString_FromStringAndSize(const char *str, int size)
@@ -58,7 +65,7 @@
----------------------------------------------------------------------
>Comment By: Zooko Ozoko (zooko)
Date: 2001-12-02 08:47
Message:
Logged In: YES
user_id=52562
Heh heh heh. I can't wait for the day that we can remotely
collaborate with something other than a web browser as the
user interface. Okay, sorry, here is a newer version of the
patch.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2001-12-02 07:34
Message:
Logged In: YES
user_id=21627
There is currently nothing attached.
----------------------------------------------------------------------
Comment By: Zooko Ozoko (zooko)
Date: 2001-12-01 12:44
Message:
Logged In: YES
user_id=52562
Okay I guess that's all mangled. DAMN, I hate trying to use
a web browser for anything other than browsing.
Anyway, I've attached the same patch.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=487906&group_id=5470