diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-06-13 20:33:02 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-06-13 20:33:02 (GMT) |
commit | 14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f (patch) | |
tree | 7b150133cdd51df851c6bdaf261cd9ea30c149af /Objects | |
parent | 654c11ee3a2c9b72c040524c9cc4f95a1858f20b (diff) | |
download | cpython-14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f.zip cpython-14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f.tar.gz cpython-14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f.tar.bz2 |
Patch #568124: Add doc string macros.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/boolobject.c | 4 | ||||
-rw-r--r-- | Objects/cobject.c | 4 | ||||
-rw-r--r-- | Objects/complexobject.c | 4 | ||||
-rw-r--r-- | Objects/descrobject.c | 4 | ||||
-rw-r--r-- | Objects/dictobject.c | 60 | ||||
-rw-r--r-- | Objects/enumobject.c | 4 | ||||
-rw-r--r-- | Objects/fileobject.c | 66 | ||||
-rw-r--r-- | Objects/floatobject.c | 4 | ||||
-rw-r--r-- | Objects/funcobject.c | 8 | ||||
-rw-r--r-- | Objects/intobject.c | 4 | ||||
-rw-r--r-- | Objects/listobject.c | 36 | ||||
-rw-r--r-- | Objects/longobject.c | 4 | ||||
-rw-r--r-- | Objects/moduleobject.c | 4 | ||||
-rw-r--r-- | Objects/rangeobject.c | 4 | ||||
-rw-r--r-- | Objects/stringobject.c | 144 | ||||
-rw-r--r-- | Objects/tupleobject.c | 4 | ||||
-rw-r--r-- | Objects/typeobject.c | 8 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 148 |
18 files changed, 260 insertions, 254 deletions
diff --git a/Objects/boolobject.c b/Objects/boolobject.c index 89a7ece..a20af00 100644 --- a/Objects/boolobject.c +++ b/Objects/boolobject.c @@ -93,12 +93,12 @@ bool_xor(PyObject *a, PyObject *b) /* Doc string */ -static char bool_doc[] = +PyDoc_STRVAR(bool_doc, "bool(x) -> bool\n\ \n\ Returns True when the argument x is true, False otherwise.\n\ The builtins True and False are the only two instances of the class bool.\n\ -The class bool is a subclass of the class int, and cannot be subclassed."; +The class bool is a subclass of the class int, and cannot be subclassed."); /* Arithmetic methods -- only so we can override &, |, ^. */ diff --git a/Objects/cobject.c b/Objects/cobject.c index 872e515..cdf4457 100644 --- a/Objects/cobject.c +++ b/Objects/cobject.c @@ -112,13 +112,13 @@ PyCObject_dealloc(PyCObject *self) } -static char PyCObject_Type__doc__[] = +PyDoc_STRVAR(PyCObject_Type__doc__, "C objects to be exported from one extension module to another\n\ \n\ C objects are used for communication between extension modules. They\n\ provide a way for an extension module to export a C interface to other\n\ extension modules, so that extension modules can use the Python import\n\ -mechanism to link to one another."; +mechanism to link to one another."); PyTypeObject PyCObject_Type = { PyObject_HEAD_INIT(&PyType_Type) diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 58ca6bc..ba1e3cc 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -912,11 +912,11 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return complex_subtype_from_c_complex(type, cr); } -static char complex_doc[] = +PyDoc_STRVAR(complex_doc, "complex(real[, imag]) -> complex number\n" "\n" "Create a complex number from a real part and an optional imaginary part.\n" -"This is equivalent to (real + imag*1j) where imag defaults to 0."; +"This is equivalent to (real + imag*1j) where imag defaults to 0."); static PyNumberMethods complex_as_number = { (binaryfunc)complex_add, /* nb_add */ diff --git a/Objects/descrobject.c b/Objects/descrobject.c index cbf56a9..1130f86 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1062,7 +1062,7 @@ property_init(PyObject *self, PyObject *args, PyObject *kwds) return 0; } -static char property_doc[] = +PyDoc_STRVAR(property_doc, "property(fget=None, fset=None, fdel=None, doc=None) -> property attribute\n" "\n" "fget is a function to be used for getting an attribute value, and likewise\n" @@ -1072,7 +1072,7 @@ static char property_doc[] = " def getx(self): return self.__x\n" " def setx(self, value): self.__x = value\n" " def delx(self): del self.__x\n" -" x = property(getx, setx, delx, \"I'm the 'x' property.\")"; +" x = property(getx, setx, delx, \"I'm the 'x' property.\")"); static int property_traverse(PyObject *self, visitproc visit, void *arg) diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 1bd2f64..d7bbef9 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -1660,48 +1660,48 @@ dict_iteritems(dictobject *dict) } -static char has_key__doc__[] = -"D.has_key(k) -> 1 if D has a key k, else 0"; +PyDoc_STRVAR(has_key__doc__, +"D.has_key(k) -> 1 if D has a key k, else 0"); -static char get__doc__[] = -"D.get(k[,d]) -> D[k] if D.has_key(k), else d. d defaults to None."; +PyDoc_STRVAR(get__doc__, +"D.get(k[,d]) -> D[k] if D.has_key(k), else d. d defaults to None."); -static char setdefault_doc__[] = -"D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if not D.has_key(k)"; +PyDoc_STRVAR(setdefault_doc__, +"D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if not D.has_key(k)"); -static char pop__doc__[] = -"D.pop(k) -> v, remove specified key and return the corresponding value"; +PyDoc_STRVAR(pop__doc__, +"D.pop(k) -> v, remove specified key and return the corresponding value"); -static char popitem__doc__[] = +PyDoc_STRVAR(popitem__doc__, "D.popitem() -> (k, v), remove and return some (key, value) pair as a\n\ -2-tuple; but raise KeyError if D is empty"; +2-tuple; but raise KeyError if D is empty"); -static char keys__doc__[] = -"D.keys() -> list of D's keys"; +PyDoc_STRVAR(keys__doc__, +"D.keys() -> list of D's keys"); -static char items__doc__[] = -"D.items() -> list of D's (key, value) pairs, as 2-tuples"; +PyDoc_STRVAR(items__doc__, +"D.items() -> list of D's (key, value) pairs, as 2-tuples"); -static char values__doc__[] = -"D.values() -> list of D's values"; +PyDoc_STRVAR(values__doc__, +"D.values() -> list of D's values"); -static char update__doc__[] = -"D.update(E) -> None. Update D from E: for k in E.keys(): D[k] = E[k]"; +PyDoc_STRVAR(update__doc__, +"D.update(E) -> None. Update D from E: for k in E.keys(): D[k] = E[k]"); -static char clear__doc__[] = -"D.clear() -> None. Remove all items from D."; +PyDoc_STRVAR(clear__doc__, +"D.clear() -> None. Remove all items from D."); -static char copy__doc__[] = -"D.copy() -> a shallow copy of D"; +PyDoc_STRVAR(copy__doc__, +"D.copy() -> a shallow copy of D"); -static char iterkeys__doc__[] = -"D.iterkeys() -> an iterator over the keys of D"; +PyDoc_STRVAR(iterkeys__doc__, +"D.iterkeys() -> an iterator over the keys of D"); -static char itervalues__doc__[] = -"D.itervalues() -> an iterator over the values of D"; +PyDoc_STRVAR(itervalues__doc__, +"D.itervalues() -> an iterator over the values of D"); -static char iteritems__doc__[] = -"D.iteritems() -> an iterator over the (key, value) items of D"; +PyDoc_STRVAR(iteritems__doc__, +"D.iteritems() -> an iterator over the (key, value) items of D"); static PyMethodDef mapp_methods[] = { {"has_key", (PyCFunction)dict_has_key, METH_O, @@ -1816,14 +1816,14 @@ dict_iter(dictobject *dict) return dictiter_new(dict, select_key); } -static char dictionary_doc[] = +PyDoc_STRVAR(dictionary_doc, "dict() -> new empty dictionary.\n" "dict(mapping) -> new dictionary initialized from a mapping object's\n" " (key, value) pairs.\n" "dict(seq) -> new dictionary initialized as if via:\n" " d = {}\n" " for k, v in seq:\n" -" d[k] = v"; +" d[k] = v"); PyTypeObject PyDict_Type = { PyObject_HEAD_INIT(&PyType_Type) diff --git a/Objects/enumobject.c b/Objects/enumobject.c index 1964956..148ac3c 100644 --- a/Objects/enumobject.c +++ b/Objects/enumobject.c @@ -90,8 +90,8 @@ static PyMethodDef enum_methods[] = { {NULL, NULL} /* sentinel */ }; -static char enum_doc[] = - "enumerate(iterable) -> create an enumerating-iterator"; +PyDoc_STRVAR(enum_doc, +"enumerate(iterable) -> create an enumerating-iterator"); PyTypeObject PyEnum_Type = { PyObject_HEAD_INIT(&PyType_Type) diff --git a/Objects/fileobject.c b/Objects/fileobject.c index a45a4cf..d4caaf0 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -1462,30 +1462,30 @@ file_writelines(PyFileObject *f, PyObject *seq) #undef CHUNKSIZE } -static char readline_doc[] = +PyDoc_STRVAR(readline_doc, "readline([size]) -> next line from the file, as a string.\n" "\n" "Retain newline. A non-negative size argument limits the maximum\n" "number of bytes to return (an incomplete line may be returned then).\n" -"Return an empty string at EOF."; +"Return an empty string at EOF."); -static char read_doc[] = +PyDoc_STRVAR(read_doc, "read([size]) -> read at most size bytes, returned as a string.\n" "\n" -"If the size argument is negative or omitted, read until EOF is reached."; +"If the size argument is negative or omitted, read until EOF is reached."); -static char write_doc[] = +PyDoc_STRVAR(write_doc, "write(str) -> None. Write string str to file.\n" "\n" "Note that due to buffering, flush() or close() may be needed before\n" -"the file on disk reflects the data written."; +"the file on disk reflects the data written."); -static char fileno_doc[] = +PyDoc_STRVAR(fileno_doc, "fileno() -> integer \"file descriptor\".\n" "\n" -"This is needed for lower-level file interfaces, such os.read()."; +"This is needed for lower-level file interfaces, such os.read()."); -static char seek_doc[] = +PyDoc_STRVAR(seek_doc, "seek(offset[, whence]) -> None. Move to new file position.\n" "\n" "Argument offset is a byte count. Optional argument whence defaults to\n" @@ -1494,53 +1494,53 @@ static char seek_doc[] = "relative to end of file, usually negative, although many platforms allow\n" "seeking beyond the end of a file).\n" "\n" -"Note that not all file objects are seekable."; +"Note that not all file objects are seekable."); #ifdef HAVE_FTRUNCATE -static char truncate_doc[] = +PyDoc_STRVAR(truncate_doc, "truncate([size]) -> None. Truncate the file to at most size bytes.\n" "\n" -"Size defaults to the current file position, as returned by tell()."; +"Size defaults to the current file position, as returned by tell()."); #endif -static char tell_doc[] = -"tell() -> current file position, an integer (may be a long integer)."; +PyDoc_STRVAR(tell_doc, +"tell() -> current file position, an integer (may be a long integer)."); -static char readinto_doc[] = -"readinto() -> Undocumented. Don't use this; it may go away."; +PyDoc_STRVAR(readinto_doc, +"readinto() -> Undocumented. Don't use this; it may go away."); -static char readlines_doc[] = +PyDoc_STRVAR(readlines_doc, "readlines([size]) -> list of strings, each a line from the file.\n" "\n" "Call readline() repeatedly and return a list of the lines so read.\n" "The optional size argument, if given, is an approximate bound on the\n" -"total number of bytes in the lines returned."; +"total number of bytes in the lines returned."); -static char xreadlines_doc[] = +PyDoc_STRVAR(xreadlines_doc, "xreadlines() -> next line from the file, as a string.\n" "\n" "Equivalent to xreadlines.xreadlines(file). This is like readline(), but\n" -"often quicker, due to reading ahead internally."; +"often quicker, due to reading ahead internally."); -static char writelines_doc[] = +PyDoc_STRVAR(writelines_doc, "writelines(sequence_of_strings) -> None. Write the strings to the file.\n" "\n" "Note that newlines are not added. The sequence can be any iterable object\n" -"producing strings. This is equivalent to calling write() for each string."; +"producing strings. This is equivalent to calling write() for each string."); -static char flush_doc[] = -"flush() -> None. Flush the internal I/O buffer."; +PyDoc_STRVAR(flush_doc, +"flush() -> None. Flush the internal I/O buffer."); -static char close_doc[] = +PyDoc_STRVAR(close_doc, "close() -> None or (perhaps) an integer. Close the file.\n" "\n" "Sets data attribute .closed to True. A closed file cannot be used for\n" "further I/O operations. close() may be called more than once without\n" "error. Some kinds of file objects (for example, opened by popen())\n" -"may return an exit status upon closing."; +"may return an exit status upon closing."); -static char isatty_doc[] = -"isatty() -> true or false. True if the file is connected to a tty device."; +PyDoc_STRVAR(isatty_doc, +"isatty() -> true or false. True if the file is connected to a tty device."); static PyMethodDef file_methods[] = { {"readline", (PyCFunction)file_readline, METH_VARARGS, readline_doc}, @@ -1687,7 +1687,8 @@ Done: return ret; } -static char file_doc[] = +PyDoc_VAR(file_doc) = +PyDoc_STR( "file(name[, mode[, buffering]]) -> file object\n" "\n" "Open a file. The mode can be 'r', 'w' or 'a' for reading (default),\n" @@ -1697,7 +1698,9 @@ static char file_doc[] = "Add a '+' to the mode to allow simultaneous reading and writing.\n" "If the buffering argument is given, 0 means unbuffered, 1 means line\n" "buffered, and larger numbers specify the buffer size.\n" +) #ifdef WITH_UNIVERSAL_NEWLINES +PyDoc_STR( "Add a 'U' to mode to open the file for input with universal newline\n" "support. Any line ending in the input file will be seen as a '\\n'\n" "in Python. Also, a file so opened gains the attribute 'newlines';\n" @@ -1705,9 +1708,12 @@ static char file_doc[] = "'\\r', '\\n', '\\r\\n' or a tuple containing all the newline types seen.\n" "\n" "'U' cannot be combined with 'w' or '+' mode.\n" +) #endif /* WITH_UNIVERSAL_NEWLINES */ +PyDoc_STR( "\n" -"Note: open() is an alias for file().\n"; +"Note: open() is an alias for file()." +); PyTypeObject PyFile_Type = { PyObject_HEAD_INIT(&PyType_Type) diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 5fd13bc..d711726 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -719,10 +719,10 @@ float_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return new; } -static char float_doc[] = +PyDoc_STRVAR(float_doc, "float(x) -> floating point number\n\ \n\ -Convert a string or number to a floating point number, if possible."; +Convert a string or number to a floating point number, if possible."); static PyNumberMethods float_as_number = { diff --git a/Objects/funcobject.c b/Objects/funcobject.c index a3541e4..f96d0dd 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -493,7 +493,7 @@ cm_init(PyObject *self, PyObject *args, PyObject *kwds) return 0; } -static char classmethod_doc[] = +PyDoc_STRVAR(classmethod_doc, "classmethod(function) -> method\n\ \n\ Convert a function to be a class method.\n\ @@ -512,7 +512,7 @@ If a class method is called for a derived class, the derived class\n\ object is passed as the implied first argument.\n\ \n\ Class methods are different than C++ or Java static methods.\n\ -If you want those, see the staticmethod builtin."; +If you want those, see the staticmethod builtin."); PyTypeObject PyClassMethod_Type = { PyObject_HEAD_INIT(&PyType_Type) @@ -625,7 +625,7 @@ sm_init(PyObject *self, PyObject *args, PyObject *kwds) return 0; } -static char staticmethod_doc[] = +PyDoc_STRVAR(staticmethod_doc, "staticmethod(function) -> method\n\ \n\ Convert a function to be a static method.\n\ @@ -641,7 +641,7 @@ It can be called either on the class (e.g. C.f()) or on an instance\n\ (e.g. C().f()). The instance is ignored except for its class.\n\ \n\ Static methods in Python are similar to those found in Java or C++.\n\ -For a more advanced concept, see the classmethod builtin."; +For a more advanced concept, see the classmethod builtin."); PyTypeObject PyStaticMethod_Type = { PyObject_HEAD_INIT(&PyType_Type) diff --git a/Objects/intobject.c b/Objects/intobject.c index ccd328d..444ada3 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -830,14 +830,14 @@ int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return new; } -static char int_doc[] = +PyDoc_STRVAR(int_doc, "int(x[, base]) -> integer\n\ \n\ Convert a string or number to an integer, if possible. A floating point\n\ argument will be truncated towards zero (this does not include a string\n\ representation of a floating point number!) When converting a string, use\n\ the optional base. It is an error to supply a base when converting a\n\ -non-string."; +non-string."); static PyNumberMethods int_as_number = { (binaryfunc)int_add, /*nb_add*/ diff --git a/Objects/listobject.c b/Objects/listobject.c index 063ebfb..f29774e 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1633,24 +1633,24 @@ list_nohash(PyObject *self) return -1; } -static char append_doc[] = -"L.append(object) -- append object to end"; -static char extend_doc[] = -"L.extend(list) -- extend list by appending list elements"; -static char insert_doc[] = -"L.insert(index, object) -- insert object before index"; -static char pop_doc[] = -"L.pop([index]) -> item -- remove and return item at index (default last)"; -static char remove_doc[] = -"L.remove(value) -- remove first occurrence of value"; -static char index_doc[] = -"L.index(value) -> integer -- return index of first occurrence of value"; -static char count_doc[] = -"L.count(value) -> integer -- return number of occurrences of value"; -static char reverse_doc[] = -"L.reverse() -- reverse *IN PLACE*"; -static char sort_doc[] = -"L.sort([cmpfunc]) -- sort *IN PLACE*; if given, cmpfunc(x, y) -> -1, 0, 1"; +PyDoc_STRVAR(append_doc, +"L.append(object) -- append object to end"); +PyDoc_STRVAR(extend_doc, +"L.extend(list) -- extend list by appending list elements"); +PyDoc_STRVAR(insert_doc, +"L.insert(index, object) -- insert object before index"); +PyDoc_STRVAR(pop_doc, +"L.pop([index]) -> item -- remove and return item at index (default last)"); +PyDoc_STRVAR(remove_doc, +"L.remove(value) -- remove first occurrence of value"); +PyDoc_STRVAR(index_doc, +"L.index(value) -> integer -- return index of first occurrence of value"); +PyDoc_STRVAR(count_doc, +"L.count(value) -> integer -- return number of occurrences of value"); +PyDoc_STRVAR(reverse_doc, +"L.reverse() -- reverse *IN PLACE*"); +PyDoc_STRVAR(sort_doc, +"L.sort([cmpfunc]) -- sort *IN PLACE*; if given, cmpfunc(x, y) -> -1, 0, 1"); static PyMethodDef list_methods[] = { {"append", (PyCFunction)listappend, METH_O, append_doc}, diff --git a/Objects/longobject.c b/Objects/longobject.c index cbc9f68..89fc8b4 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -2261,14 +2261,14 @@ long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return (PyObject *)new; } -static char long_doc[] = +PyDoc_STRVAR(long_doc, "long(x[, base]) -> integer\n\ \n\ Convert a string or number to a long integer, if possible. A floating\n\ point argument will be truncated towards zero (this does not include a\n\ string representation of a floating point number!) When converting a\n\ string, use the optional base. It is an error to supply a base when\n\ -converting a non-string."; +converting a non-string."); static PyNumberMethods long_as_number = { (binaryfunc) long_add, /*nb_add*/ diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index b46805d..812cbc4 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -209,11 +209,11 @@ module_traverse(PyModuleObject *m, visitproc visit, void *arg) return 0; } -static char module_doc[] = +PyDoc_STRVAR(module_doc, "module(name[, doc])\n\ \n\ Create a module object.\n\ -The name must be a string; the optional doc argument can have any type."; +The name must be a string; the optional doc argument can have any type."); PyTypeObject PyModule_Type = { PyObject_HEAD_INIT(&PyType_Type) diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 1360864..c3c6050 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -110,12 +110,12 @@ range_new(PyTypeObject *type, PyObject *args, PyObject *kw) return PyRange_New(ilow, n, istep, 1); } -static char range_doc[] = +PyDoc_STRVAR(range_doc, "xrange([start,] stop[, step]) -> xrange object\n\ \n\ Like range(), but instead of returning a list, returns an object that\n\ generates the numbers in the range on demand. This is slightly slower\n\ -than range() but more memory efficient."; +than range() but more memory efficient."); static PyObject * range_item(rangeobject *r, int i) diff --git a/Objects/stringobject.c b/Objects/stringobject.c index b88778e..243fcc6 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -1117,13 +1117,13 @@ split_whitespace(const char *s, int len, int maxsplit) } -static char split__doc__[] = +PyDoc_STRVAR(split__doc__, "S.split([sep [,maxsplit]]) -> list of strings\n\ \n\ Return a list of the words in the string S, using sep as the\n\ delimiter string. If maxsplit is given, at most maxsplit\n\ splits are done. If sep is not specified, any whitespace string\n\ -is a separator."; +is a separator."); static PyObject * string_split(PyStringObject *self, PyObject *args) @@ -1191,11 +1191,11 @@ string_split(PyStringObject *self, PyObject *args) } -static char join__doc__[] = +PyDoc_STRVAR(join__doc__, "S.join(sequence) -> string\n\ \n\ Return a string which is the concatenation of the strings in the\n\ -sequence. The separator between elements is S."; +sequence. The separator between elements is S."); static PyObject * string_join(PyStringObject *self, PyObject *orig) @@ -1365,14 +1365,14 @@ string_find_internal(PyStringObject *self, PyObject *args, int dir) } -static char find__doc__[] = +PyDoc_STRVAR(find__doc__, "S.find(sub [,start [,end]]) -> int\n\ \n\ Return the lowest index in S where substring sub is found,\n\ such that sub is contained within s[start,end]. Optional\n\ arguments start and end are interpreted as in slice notation.\n\ \n\ -Return -1 on failure."; +Return -1 on failure."); static PyObject * string_find(PyStringObject *self, PyObject *args) @@ -1384,10 +1384,10 @@ string_find(PyStringObject *self, PyObject *args) } -static char index__doc__[] = +PyDoc_STRVAR(index__doc__, "S.index(sub [,start [,end]]) -> int\n\ \n\ -Like S.find() but raise ValueError when the substring is not found."; +Like S.find() but raise ValueError when the substring is not found."); static PyObject * string_index(PyStringObject *self, PyObject *args) @@ -1404,14 +1404,14 @@ string_index(PyStringObject *self, PyObject *args) } -static char rfind__doc__[] = +PyDoc_STRVAR(rfind__doc__, "S.rfind(sub [,start [,end]]) -> int\n\ \n\ Return the highest index in S where substring sub is found,\n\ such that sub is contained within s[start,end]. Optional\n\ arguments start and end are interpreted as in slice notation.\n\ \n\ -Return -1 on failure."; +Return -1 on failure."); static PyObject * string_rfind(PyStringObject *self, PyObject *args) @@ -1423,10 +1423,10 @@ string_rfind(PyStringObject *self, PyObject *args) } -static char rindex__doc__[] = +PyDoc_STRVAR(rindex__doc__, "S.rindex(sub [,start [,end]]) -> int\n\ \n\ -Like S.rfind() but raise ValueError when the substring is not found."; +Like S.rfind() but raise ValueError when the substring is not found."); static PyObject * string_rindex(PyStringObject *self, PyObject *args) @@ -1546,13 +1546,13 @@ do_argstrip(PyStringObject *self, int striptype, PyObject *args) } -static char strip__doc__[] = +PyDoc_STRVAR(strip__doc__, "S.strip([sep]) -> string or unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ If sep is given and not None, remove characters in sep instead.\n\ -If sep is unicode, S will be converted to unicode before stripping"; +If sep is unicode, S will be converted to unicode before stripping"); static PyObject * string_strip(PyStringObject *self, PyObject *args) @@ -1564,12 +1564,12 @@ string_strip(PyStringObject *self, PyObject *args) } -static char lstrip__doc__[] = +PyDoc_STRVAR(lstrip__doc__, "S.lstrip([sep]) -> string or unicode\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ If sep is given and not None, remove characters in sep instead.\n\ -If sep is unicode, S will be converted to unicode before stripping"; +If sep is unicode, S will be converted to unicode before stripping"); static PyObject * string_lstrip(PyStringObject *self, PyObject *args) @@ -1581,12 +1581,12 @@ string_lstrip(PyStringObject *self, PyObject *args) } -static char rstrip__doc__[] = +PyDoc_STRVAR(rstrip__doc__, "S.rstrip([sep]) -> string or unicode\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ If sep is given and not None, remove characters in sep instead.\n\ -If sep is unicode, S will be converted to unicode before stripping"; +If sep is unicode, S will be converted to unicode before stripping"); static PyObject * string_rstrip(PyStringObject *self, PyObject *args) @@ -1598,10 +1598,10 @@ string_rstrip(PyStringObject *self, PyObject *args) } -static char lower__doc__[] = +PyDoc_STRVAR(lower__doc__, "S.lower() -> string\n\ \n\ -Return a copy of the string S converted to lowercase."; +Return a copy of the string S converted to lowercase."); static PyObject * string_lower(PyStringObject *self) @@ -1626,10 +1626,10 @@ string_lower(PyStringObject *self) } -static char upper__doc__[] = +PyDoc_STRVAR(upper__doc__, "S.upper() -> string\n\ \n\ -Return a copy of the string S converted to uppercase."; +Return a copy of the string S converted to uppercase."); static PyObject * string_upper(PyStringObject *self) @@ -1654,11 +1654,11 @@ string_upper(PyStringObject *self) } -static char title__doc__[] = +PyDoc_STRVAR(title__doc__, "S.title() -> string\n\ \n\ Return a titlecased version of S, i.e. words start with uppercase\n\ -characters, all remaining cased characters have lowercase."; +characters, all remaining cased characters have lowercase."); static PyObject* string_title(PyStringObject *self) @@ -1689,11 +1689,11 @@ string_title(PyStringObject *self) return new; } -static char capitalize__doc__[] = +PyDoc_STRVAR(capitalize__doc__, "S.capitalize() -> string\n\ \n\ Return a copy of the string S with only its first character\n\ -capitalized."; +capitalized."); static PyObject * string_capitalize(PyStringObject *self) @@ -1726,12 +1726,12 @@ string_capitalize(PyStringObject *self) } -static char count__doc__[] = +PyDoc_STRVAR(count__doc__, "S.count(sub[, start[, end]]) -> int\n\ \n\ Return the number of occurrences of substring sub in string\n\ S[start:end]. Optional arguments start and end are\n\ -interpreted as in slice notation."; +interpreted as in slice notation."); static PyObject * string_count(PyStringObject *self, PyObject *args) @@ -1790,11 +1790,11 @@ string_count(PyStringObject *self, PyObject *args) } -static char swapcase__doc__[] = +PyDoc_STRVAR(swapcase__doc__, "S.swapcase() -> string\n\ \n\ Return a copy of the string S with uppercase characters\n\ -converted to lowercase and vice versa."; +converted to lowercase and vice versa."); static PyObject * string_swapcase(PyStringObject *self) @@ -1823,13 +1823,13 @@ string_swapcase(PyStringObject *self) } -static char translate__doc__[] = +PyDoc_STRVAR(translate__doc__, "S.translate(table [,deletechars]) -> string\n\ \n\ Return a copy of the string S, where all characters occurring\n\ in the optional argument deletechars are removed, and the\n\ remaining characters have been mapped through the given\n\ -translation table, which must be a string of length 256."; +translation table, which must be a string of length 256."); static PyObject * string_translate(PyStringObject *self, PyObject *args) @@ -2079,12 +2079,12 @@ mymemreplace(const char *str, int len, /* input string */ } -static char replace__doc__[] = +PyDoc_STRVAR(replace__doc__, "S.replace (old, new[, maxsplit]) -> string\n\ \n\ Return a copy of string S with all occurrences of substring\n\ old replaced by new. If the optional argument maxsplit is\n\ -given, only the first maxsplit occurrences are replaced."; +given, only the first maxsplit occurrences are replaced."); static PyObject * string_replace(PyStringObject *self, PyObject *args) @@ -2154,12 +2154,12 @@ string_replace(PyStringObject *self, PyObject *args) } -static char startswith__doc__[] = +PyDoc_STRVAR(startswith__doc__, "S.startswith(prefix[, start[, end]]) -> bool\n\ \n\ Return True if S starts with the specified prefix, False otherwise. With\n\ optional start, test S beginning at that position. With optional end, stop\n\ -comparing S at that position."; +comparing S at that position."); static PyObject * string_startswith(PyStringObject *self, PyObject *args) @@ -2213,12 +2213,12 @@ string_startswith(PyStringObject *self, PyObject *args) } -static char endswith__doc__[] = +PyDoc_STRVAR(endswith__doc__, "S.endswith(suffix[, start[, end]]) -> bool\n\ \n\ Return True if S ends with the specified suffix, False otherwise. With\n\ optional start, test S beginning at that position. With optional end, stop\n\ -comparing S at that position."; +comparing S at that position."); static PyObject * string_endswith(PyStringObject *self, PyObject *args) @@ -2265,13 +2265,13 @@ string_endswith(PyStringObject *self, PyObject *args) } -static char encode__doc__[] = +PyDoc_STRVAR(encode__doc__, "S.encode([encoding[,errors]]) -> object\n\ \n\ Encodes S using the codec registered for encoding. encoding defaults\n\ to the default encoding. errors may be given to set a different error\n\ handling scheme. Default is 'strict' meaning that encoding errors raise\n\ -a ValueError. Other possible values are 'ignore' and 'replace'."; +a ValueError. Other possible values are 'ignore' and 'replace'."); static PyObject * string_encode(PyStringObject *self, PyObject *args) @@ -2284,13 +2284,13 @@ string_encode(PyStringObject *self, PyObject *args) } -static char decode__doc__[] = +PyDoc_STRVAR(decode__doc__, "S.decode([encoding[,errors]]) -> object\n\ \n\ Decodes S using the codec registered for encoding. encoding defaults\n\ to the default encoding. errors may be given to set a different error\n\ handling scheme. Default is 'strict' meaning that encoding errors raise\n\ -a ValueError. Other possible values are 'ignore' and 'replace'."; +a ValueError. Other possible values are 'ignore' and 'replace'."); static PyObject * string_decode(PyStringObject *self, PyObject *args) @@ -2303,11 +2303,11 @@ string_decode(PyStringObject *self, PyObject *args) } -static char expandtabs__doc__[] = +PyDoc_STRVAR(expandtabs__doc__, "S.expandtabs([tabsize]) -> string\n\ \n\ Return a copy of S where all tab characters are expanded using spaces.\n\ -If tabsize is not given, a tab size of 8 characters is assumed."; +If tabsize is not given, a tab size of 8 characters is assumed."); static PyObject* string_expandtabs(PyStringObject *self, PyObject *args) @@ -2395,11 +2395,11 @@ pad(PyStringObject *self, int left, int right, char fill) return u; } -static char ljust__doc__[] = +PyDoc_STRVAR(ljust__doc__, "S.ljust(width) -> string\n" "\n" "Return S left justified in a string of length width. Padding is\n" -"done using spaces."; +"done using spaces."); static PyObject * string_ljust(PyStringObject *self, PyObject *args) @@ -2417,11 +2417,11 @@ string_ljust(PyStringObject *self, PyObject *args) } -static char rjust__doc__[] = +PyDoc_STRVAR(rjust__doc__, "S.rjust(width) -> string\n" "\n" "Return S right justified in a string of length width. Padding is\n" -"done using spaces."; +"done using spaces."); static PyObject * string_rjust(PyStringObject *self, PyObject *args) @@ -2439,11 +2439,11 @@ string_rjust(PyStringObject *self, PyObject *args) } -static char center__doc__[] = +PyDoc_STRVAR(center__doc__, "S.center(width) -> string\n" "\n" "Return S centered in a string of length width. Padding is done\n" -"using spaces."; +"using spaces."); static PyObject * string_center(PyStringObject *self, PyObject *args) @@ -2465,11 +2465,11 @@ string_center(PyStringObject *self, PyObject *args) return pad(self, left, marg - left, ' '); } -static char zfill__doc__[] = +PyDoc_STRVAR(zfill__doc__, "S.zfill(width) -> string\n" "\n" "Pad a numeric string S with zeros on the left, to fill a field\n" -"of the specified width. The string S is never truncated."; +"of the specified width. The string S is never truncated."); static PyObject * string_zfill(PyStringObject *self, PyObject *args) @@ -2511,11 +2511,11 @@ string_zfill(PyStringObject *self, PyObject *args) return (PyObject*) s; } -static char isspace__doc__[] = +PyDoc_STRVAR(isspace__doc__, "S.isspace() -> bool\n" "\n" "Return True if there are only whitespace characters in S,\n" -"False otherwise."; +"False otherwise."); static PyObject* string_isspace(PyStringObject *self) @@ -2542,11 +2542,11 @@ string_isspace(PyStringObject *self) } -static char isalpha__doc__[] = +PyDoc_STRVAR(isalpha__doc__, "S.isalpha() -> bool\n\ \n\ Return True if all characters in S are alphabetic\n\ -and there is at least one character in S, False otherwise."; +and there is at least one character in S, False otherwise."); static PyObject* string_isalpha(PyStringObject *self) @@ -2573,11 +2573,11 @@ string_isalpha(PyStringObject *self) } -static char isalnum__doc__[] = +PyDoc_STRVAR(isalnum__doc__, "S.isalnum() -> bool\n\ \n\ Return True if all characters in S are alphanumeric\n\ -and there is at least one character in S, False otherwise."; +and there is at least one character in S, False otherwise."); static PyObject* string_isalnum(PyStringObject *self) @@ -2604,11 +2604,11 @@ string_isalnum(PyStringObject *self) } -static char isdigit__doc__[] = +PyDoc_STRVAR(isdigit__doc__, "S.isdigit() -> bool\n\ \n\ Return True if there are only digit characters in S,\n\ -False otherwise."; +False otherwise."); static PyObject* string_isdigit(PyStringObject *self) @@ -2635,11 +2635,11 @@ string_isdigit(PyStringObject *self) } -static char islower__doc__[] = +PyDoc_STRVAR(islower__doc__, "S.islower() -> bool\n\ \n\ Return True if all cased characters in S are lowercase and there is\n\ -at least one cased character in S, False otherwise."; +at least one cased character in S, False otherwise."); static PyObject* string_islower(PyStringObject *self) @@ -2669,11 +2669,11 @@ string_islower(PyStringObject *self) } -static char isupper__doc__[] = +PyDoc_STRVAR(isupper__doc__, "S.isupper() -> bool\n\ \n\ Return True if all cased characters in S are uppercase and there is\n\ -at least one cased character in S, False otherwise."; +at least one cased character in S, False otherwise."); static PyObject* string_isupper(PyStringObject *self) @@ -2703,12 +2703,12 @@ string_isupper(PyStringObject *self) } -static char istitle__doc__[] = +PyDoc_STRVAR(istitle__doc__, "S.istitle() -> bool\n\ \n\ Return True if S is a titlecased string, i.e. uppercase characters\n\ may only follow uncased characters and lowercase characters only cased\n\ -ones. Return False otherwise."; +ones. Return False otherwise."); static PyObject* string_istitle(PyStringObject *self, PyObject *uncased) @@ -2751,12 +2751,12 @@ string_istitle(PyStringObject *self, PyObject *uncased) } -static char splitlines__doc__[] = +PyDoc_STRVAR(splitlines__doc__, "S.splitlines([keepends]) -> list of strings\n\ \n\ Return a list of the lines in S, breaking at line boundaries.\n\ Line breaks are not included in the resulting list unless keepends\n\ -is given and true."; +is given and true."); #define SPLIT_APPEND(data, left, right) \ str = PyString_FromStringAndSize(data + left, right - left); \ @@ -2923,8 +2923,8 @@ basestring_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; } -static char basestring_doc[] = -"Type basestring cannot be instantiated; it is the base for str and unicode."; +PyDoc_STRVAR(basestring_doc, +"Type basestring cannot be instantiated; it is the base for str and unicode."); PyTypeObject PyBaseString_Type = { PyObject_HEAD_INIT(&PyType_Type) @@ -2969,11 +2969,11 @@ PyTypeObject PyBaseString_Type = { 0, /* tp_free */ }; -static char string_doc[] = +PyDoc_STRVAR(string_doc, "str(object) -> string\n\ \n\ Return a nice string representation of the object.\n\ -If the argument is a string, the return value is the same object."; +If the argument is a string, the return value is the same object."); PyTypeObject PyString_Type = { PyObject_HEAD_INIT(&PyType_Type) diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 203801e..a207102 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -524,11 +524,11 @@ tuple_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return new; } -static char tuple_doc[] = +PyDoc_STRVAR(tuple_doc, "tuple() -> an empty tuple\n" "tuple(sequence) -> tuple initialized from sequence's items\n" "\n" -"If the argument is a tuple, the return value is the same object."; +"If the argument is a tuple, the return value is the same object."); static PySequenceMethods tuple_as_sequence = { (inquiry)tuplelength, /* sq_length */ diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 26222fa..b9890ea 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1487,9 +1487,9 @@ static PyMethodDef type_methods[] = { {0} }; -static char type_doc[] = +PyDoc_STRVAR(type_doc, "type(object) -> the object's type\n" -"type(name, bases, dict) -> a new type"; +"type(name, bases, dict) -> a new type"); static int type_traverse(PyTypeObject *type, visitproc visit, void *arg) @@ -4355,14 +4355,14 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds) return 0; } -static char super_doc[] = +PyDoc_STRVAR(super_doc, "super(type) -> unbound super object\n" "super(type, obj) -> bound super object; requires isinstance(obj, type)\n" "super(type, type2) -> bound super object; requires issubclass(type2, type)\n" "Typical use to call a cooperative superclass method:\n" "class C(B):\n" " def meth(self, arg):\n" -" super(C, self).meth(arg)"; +" super(C, self).meth(arg)"); static int super_traverse(PyObject *self, visitproc visit, void *arg) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 6e0fd9f..cd081ad 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3527,11 +3527,11 @@ PyObject *replace(PyUnicodeObject *self, /* --- Unicode Object Methods --------------------------------------------- */ -static char title__doc__[] = +PyDoc_STRVAR(title__doc__, "S.title() -> unicode\n\ \n\ Return a titlecased version of S, i.e. words start with title case\n\ -characters, all remaining cased characters have lower case."; +characters, all remaining cased characters have lower case."); static PyObject* unicode_title(PyUnicodeObject *self) @@ -3539,11 +3539,11 @@ unicode_title(PyUnicodeObject *self) return fixup(self, fixtitle); } -static char capitalize__doc__[] = +PyDoc_STRVAR(capitalize__doc__, "S.capitalize() -> unicode\n\ \n\ Return a capitalized version of S, i.e. make the first character\n\ -have upper case."; +have upper case."); static PyObject* unicode_capitalize(PyUnicodeObject *self) @@ -3552,11 +3552,11 @@ unicode_capitalize(PyUnicodeObject *self) } #if 0 -static char capwords__doc__[] = +PyDoc_STRVAR(capwords__doc__, "S.capwords() -> unicode\n\ \n\ Apply .capitalize() to all words in S and return the result with\n\ -normalized whitespace (all whitespace strings are replaced by ' ')."; +normalized whitespace (all whitespace strings are replaced by ' ')."); static PyObject* unicode_capwords(PyUnicodeObject *self) @@ -3589,11 +3589,11 @@ onError: } #endif -static char center__doc__[] = +PyDoc_STRVAR(center__doc__, "S.center(width) -> unicode\n\ \n\ Return S centered in a Unicode string of length width. Padding is done\n\ -using spaces."; +using spaces."); static PyObject * unicode_center(PyUnicodeObject *self, PyObject *args) @@ -3818,12 +3818,12 @@ onError: return NULL; } -static char count__doc__[] = +PyDoc_STRVAR(count__doc__, "S.count(sub[, start[, end]]) -> int\n\ \n\ Return the number of occurrences of substring sub in Unicode string\n\ S[start:end]. Optional arguments start and end are\n\ -interpreted as in slice notation."; +interpreted as in slice notation."); static PyObject * unicode_count(PyUnicodeObject *self, PyObject *args) @@ -3859,13 +3859,13 @@ unicode_count(PyUnicodeObject *self, PyObject *args) return result; } -static char encode__doc__[] = +PyDoc_STRVAR(encode__doc__, "S.encode([encoding[,errors]]) -> string\n\ \n\ Return an encoded string version of S. Default encoding is the current\n\ default string encoding. errors may be given to set a different error\n\ handling scheme. Default is 'strict' meaning that encoding errors raise\n\ -a ValueError. Other possible values are 'ignore' and 'replace'."; +a ValueError. Other possible values are 'ignore' and 'replace'."); static PyObject * unicode_encode(PyUnicodeObject *self, PyObject *args) @@ -3877,11 +3877,11 @@ unicode_encode(PyUnicodeObject *self, PyObject *args) return PyUnicode_AsEncodedString((PyObject *)self, encoding, errors); } -static char expandtabs__doc__[] = +PyDoc_STRVAR(expandtabs__doc__, "S.expandtabs([tabsize]) -> unicode\n\ \n\ Return a copy of S where all tab characters are expanded using spaces.\n\ -If tabsize is not given, a tab size of 8 characters is assumed."; +If tabsize is not given, a tab size of 8 characters is assumed."); static PyObject* unicode_expandtabs(PyUnicodeObject *self, PyObject *args) @@ -3939,14 +3939,14 @@ unicode_expandtabs(PyUnicodeObject *self, PyObject *args) return (PyObject*) u; } -static char find__doc__[] = +PyDoc_STRVAR(find__doc__, "S.find(sub [,start [,end]]) -> int\n\ \n\ Return the lowest index in S where substring sub is found,\n\ such that sub is contained within s[start,end]. Optional\n\ arguments start and end are interpreted as in slice notation.\n\ \n\ -Return -1 on failure."; +Return -1 on failure."); static PyObject * unicode_find(PyUnicodeObject *self, PyObject *args) @@ -4008,10 +4008,10 @@ unicode_hash(PyUnicodeObject *self) return x; } -static char index__doc__[] = +PyDoc_STRVAR(index__doc__, "S.index(sub [,start [,end]]) -> int\n\ \n\ -Like S.find() but raise ValueError when the substring is not found."; +Like S.find() but raise ValueError when the substring is not found."); static PyObject * unicode_index(PyUnicodeObject *self, PyObject *args) @@ -4040,11 +4040,11 @@ unicode_index(PyUnicodeObject *self, PyObject *args) return PyInt_FromLong(result); } -static char islower__doc__[] = +PyDoc_STRVAR(islower__doc__, "S.islower() -> bool\n\ \n\ Return True if all cased characters in S are lowercase and there is\n\ -at least one cased character in S, False otherwise."; +at least one cased character in S, False otherwise."); static PyObject* unicode_islower(PyUnicodeObject *self) @@ -4074,11 +4074,11 @@ unicode_islower(PyUnicodeObject *self) return PyBool_FromLong(cased); } -static char isupper__doc__[] = +PyDoc_STRVAR(isupper__doc__, "S.isupper() -> bool\n\ \n\ Return True if all cased characters in S are uppercase and there is\n\ -at least one cased character in S, False otherwise."; +at least one cased character in S, False otherwise."); static PyObject* unicode_isupper(PyUnicodeObject *self) @@ -4108,12 +4108,12 @@ unicode_isupper(PyUnicodeObject *self) return PyBool_FromLong(cased); } -static char istitle__doc__[] = +PyDoc_STRVAR(istitle__doc__, "S.istitle() -> bool\n\ \n\ Return True if S is a titlecased string, i.e. upper- and titlecase\n\ characters may only follow uncased characters and lowercase characters\n\ -only cased ones. Return False otherwise."; +only cased ones. Return False otherwise."); static PyObject* unicode_istitle(PyUnicodeObject *self) @@ -4155,11 +4155,11 @@ unicode_istitle(PyUnicodeObject *self) return PyBool_FromLong(cased); } -static char isspace__doc__[] = +PyDoc_STRVAR(isspace__doc__, "S.isspace() -> bool\n\ \n\ Return True if there are only whitespace characters in S,\n\ -False otherwise."; +False otherwise."); static PyObject* unicode_isspace(PyUnicodeObject *self) @@ -4184,11 +4184,11 @@ unicode_isspace(PyUnicodeObject *self) return PyBool_FromLong(1); } -static char isalpha__doc__[] = +PyDoc_STRVAR(isalpha__doc__, "S.isalpha() -> bool\n\ \n\ Return True if all characters in S are alphabetic\n\ -and there is at least one character in S, False otherwise."; +and there is at least one character in S, False otherwise."); static PyObject* unicode_isalpha(PyUnicodeObject *self) @@ -4213,11 +4213,11 @@ unicode_isalpha(PyUnicodeObject *self) return PyBool_FromLong(1); } -static char isalnum__doc__[] = +PyDoc_STRVAR(isalnum__doc__, "S.isalnum() -> bool\n\ \n\ Return True if all characters in S are alphanumeric\n\ -and there is at least one character in S, False otherwise."; +and there is at least one character in S, False otherwise."); static PyObject* unicode_isalnum(PyUnicodeObject *self) @@ -4242,11 +4242,11 @@ unicode_isalnum(PyUnicodeObject *self) return PyBool_FromLong(1); } -static char isdecimal__doc__[] = +PyDoc_STRVAR(isdecimal__doc__, "S.isdecimal() -> bool\n\ \n\ Return True if there are only decimal characters in S,\n\ -False otherwise."; +False otherwise."); static PyObject* unicode_isdecimal(PyUnicodeObject *self) @@ -4271,11 +4271,11 @@ unicode_isdecimal(PyUnicodeObject *self) return PyBool_FromLong(1); } -static char isdigit__doc__[] = +PyDoc_STRVAR(isdigit__doc__, "S.isdigit() -> bool\n\ \n\ Return True if there are only digit characters in S,\n\ -False otherwise."; +False otherwise."); static PyObject* unicode_isdigit(PyUnicodeObject *self) @@ -4300,11 +4300,11 @@ unicode_isdigit(PyUnicodeObject *self) return PyBool_FromLong(1); } -static char isnumeric__doc__[] = +PyDoc_STRVAR(isnumeric__doc__, "S.isnumeric() -> bool\n\ \n\ Return True if there are only numeric characters in S,\n\ -False otherwise."; +False otherwise."); static PyObject* unicode_isnumeric(PyUnicodeObject *self) @@ -4329,11 +4329,11 @@ unicode_isnumeric(PyUnicodeObject *self) return PyBool_FromLong(1); } -static char join__doc__[] = +PyDoc_STRVAR(join__doc__, "S.join(sequence) -> unicode\n\ \n\ Return a string which is the concatenation of the strings in the\n\ -sequence. The separator between elements is S."; +sequence. The separator between elements is S."); static PyObject* unicode_join(PyObject *self, PyObject *data) @@ -4347,11 +4347,11 @@ unicode_length(PyUnicodeObject *self) return self->length; } -static char ljust__doc__[] = +PyDoc_STRVAR(ljust__doc__, "S.ljust(width) -> unicode\n\ \n\ Return S left justified in a Unicode string of length width. Padding is\n\ -done using spaces."; +done using spaces."); static PyObject * unicode_ljust(PyUnicodeObject *self, PyObject *args) @@ -4368,10 +4368,10 @@ unicode_ljust(PyUnicodeObject *self, PyObject *args) return (PyObject*) pad(self, 0, width - self->length, ' '); } -static char lower__doc__[] = +PyDoc_STRVAR(lower__doc__, "S.lower() -> unicode\n\ \n\ -Return a copy of the string S converted to lowercase."; +Return a copy of the string S converted to lowercase."); static PyObject* unicode_lower(PyUnicodeObject *self) @@ -4494,13 +4494,13 @@ do_argstrip(PyUnicodeObject *self, int striptype, PyObject *args) } -static char strip__doc__[] = +PyDoc_STRVAR(strip__doc__, "S.strip([sep]) -> unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ If sep is given and not None, remove characters in sep instead.\n\ -If sep is a str, it will be converted to unicode before stripping"; +If sep is a str, it will be converted to unicode before stripping"); static PyObject * unicode_strip(PyUnicodeObject *self, PyObject *args) @@ -4512,12 +4512,12 @@ unicode_strip(PyUnicodeObject *self, PyObject *args) } -static char lstrip__doc__[] = +PyDoc_STRVAR(lstrip__doc__, "S.lstrip([sep]) -> unicode\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ If sep is given and not None, remove characters in sep instead.\n\ -If sep is a str, it will be converted to unicode before stripping"; +If sep is a str, it will be converted to unicode before stripping"); static PyObject * unicode_lstrip(PyUnicodeObject *self, PyObject *args) @@ -4529,12 +4529,12 @@ unicode_lstrip(PyUnicodeObject *self, PyObject *args) } -static char rstrip__doc__[] = +PyDoc_STRVAR(rstrip__doc__, "S.rstrip([sep]) -> unicode\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ If sep is given and not None, remove characters in sep instead.\n\ -If sep is a str, it will be converted to unicode before stripping"; +If sep is a str, it will be converted to unicode before stripping"); static PyObject * unicode_rstrip(PyUnicodeObject *self, PyObject *args) @@ -4626,12 +4626,12 @@ PyObject *PyUnicode_Replace(PyObject *obj, return result; } -static char replace__doc__[] = +PyDoc_STRVAR(replace__doc__, "S.replace (old, new[, maxsplit]) -> unicode\n\ \n\ Return a copy of S with all occurrences of substring\n\ old replaced by new. If the optional argument maxsplit is\n\ -given, only the first maxsplit occurrences are replaced."; +given, only the first maxsplit occurrences are replaced."); static PyObject* unicode_replace(PyUnicodeObject *self, PyObject *args) @@ -4665,14 +4665,14 @@ PyObject *unicode_repr(PyObject *unicode) 1); } -static char rfind__doc__[] = +PyDoc_STRVAR(rfind__doc__, "S.rfind(sub [,start [,end]]) -> int\n\ \n\ Return the highest index in S where substring sub is found,\n\ such that sub is contained within s[start,end]. Optional\n\ arguments start and end are interpreted as in slice notation.\n\ \n\ -Return -1 on failure."; +Return -1 on failure."); static PyObject * unicode_rfind(PyUnicodeObject *self, PyObject *args) @@ -4696,10 +4696,10 @@ unicode_rfind(PyUnicodeObject *self, PyObject *args) return result; } -static char rindex__doc__[] = +PyDoc_STRVAR(rindex__doc__, "S.rindex(sub [,start [,end]]) -> int\n\ \n\ -Like S.rfind() but raise ValueError when the substring is not found."; +Like S.rfind() but raise ValueError when the substring is not found."); static PyObject * unicode_rindex(PyUnicodeObject *self, PyObject *args) @@ -4727,11 +4727,11 @@ unicode_rindex(PyUnicodeObject *self, PyObject *args) return PyInt_FromLong(result); } -static char rjust__doc__[] = +PyDoc_STRVAR(rjust__doc__, "S.rjust(width) -> unicode\n\ \n\ Return S right justified in a Unicode string of length width. Padding is\n\ -done using spaces."; +done using spaces."); static PyObject * unicode_rjust(PyUnicodeObject *self, PyObject *args) @@ -4794,13 +4794,13 @@ PyObject *PyUnicode_Split(PyObject *s, return result; } -static char split__doc__[] = +PyDoc_STRVAR(split__doc__, "S.split([sep [,maxsplit]]) -> list of strings\n\ \n\ Return a list of the words in S, using sep as the\n\ delimiter string. If maxsplit is given, at most maxsplit\n\ splits are done. If sep is not specified, any whitespace string\n\ -is a separator."; +is a separator."); static PyObject* unicode_split(PyUnicodeObject *self, PyObject *args) @@ -4819,12 +4819,12 @@ unicode_split(PyUnicodeObject *self, PyObject *args) return PyUnicode_Split((PyObject *)self, substring, maxcount); } -static char splitlines__doc__[] = +PyDoc_STRVAR(splitlines__doc__, "S.splitlines([keepends]]) -> list of strings\n\ \n\ Return a list of the lines in S, breaking at line boundaries.\n\ Line breaks are not included in the resulting list unless keepends\n\ -is given and true."; +is given and true."); static PyObject* unicode_splitlines(PyUnicodeObject *self, PyObject *args) @@ -4843,11 +4843,11 @@ PyObject *unicode_str(PyUnicodeObject *self) return PyUnicode_AsEncodedString((PyObject *)self, NULL, NULL); } -static char swapcase__doc__[] = +PyDoc_STRVAR(swapcase__doc__, "S.swapcase() -> unicode\n\ \n\ Return a copy of S with uppercase characters converted to lowercase\n\ -and vice versa."; +and vice versa."); static PyObject* unicode_swapcase(PyUnicodeObject *self) @@ -4855,13 +4855,13 @@ unicode_swapcase(PyUnicodeObject *self) return fixup(self, fixswapcase); } -static char translate__doc__[] = +PyDoc_STRVAR(translate__doc__, "S.translate(table) -> unicode\n\ \n\ Return a copy of the string S, where all characters have been mapped\n\ through the given translation table, which must be a mapping of\n\ Unicode ordinals to Unicode ordinals or None. Unmapped characters\n\ -are left untouched. Characters mapped to None are deleted."; +are left untouched. Characters mapped to None are deleted."); static PyObject* unicode_translate(PyUnicodeObject *self, PyObject *table) @@ -4872,10 +4872,10 @@ unicode_translate(PyUnicodeObject *self, PyObject *table) "ignore"); } -static char upper__doc__[] = +PyDoc_STRVAR(upper__doc__, "S.upper() -> unicode\n\ \n\ -Return a copy of S converted to uppercase."; +Return a copy of S converted to uppercase."); static PyObject* unicode_upper(PyUnicodeObject *self) @@ -4883,11 +4883,11 @@ unicode_upper(PyUnicodeObject *self) return fixup(self, fixupper); } -static char zfill__doc__[] = +PyDoc_STRVAR(zfill__doc__, "S.zfill(width) -> unicode\n\ \n\ Pad a numeric string x with zeros on the left, to fill a field\n\ -of the specified width. The string x is never truncated."; +of the specified width. The string x is never truncated."); static PyObject * unicode_zfill(PyUnicodeObject *self, PyObject *args) @@ -4935,12 +4935,12 @@ unicode_freelistsize(PyUnicodeObject *self) } #endif -static char startswith__doc__[] = +PyDoc_STRVAR(startswith__doc__, "S.startswith(prefix[, start[, end]]) -> bool\n\ \n\ Return True if S starts with the specified prefix, False otherwise. With\n\ optional start, test S beginning at that position. With optional end, stop\n\ -comparing S at that position."; +comparing S at that position."); static PyObject * unicode_startswith(PyUnicodeObject *self, @@ -4966,12 +4966,12 @@ unicode_startswith(PyUnicodeObject *self, } -static char endswith__doc__[] = +PyDoc_STRVAR(endswith__doc__, "S.endswith(suffix[, start[, end]]) -> bool\n\ \n\ Return True if S ends with the specified suffix, False otherwise. With\n\ optional start, test S beginning at that position. With optional end, stop\n\ -comparing S at that position."; +comparing S at that position."); static PyObject * unicode_endswith(PyUnicodeObject *self, @@ -5847,12 +5847,12 @@ unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return (PyObject *)pnew; } -static char unicode_doc[] = +PyDoc_STRVAR(unicode_doc, "unicode(string [, encoding[, errors]]) -> object\n\ \n\ Create a new Unicode object from the given encoded string.\n\ encoding defaults to the current default string encoding and \n\ -errors, defining the error handling, to 'strict'."; +errors, defining the error handling, to 'strict'."); PyTypeObject PyUnicode_Type = { PyObject_HEAD_INIT(&PyType_Type) |