Index: Lib/string.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/string.py,v retrieving revision 1.67 diff -c -r1.67 string.py *** Lib/string.py 14 Nov 2002 03:31:32 -0000 1.67 --- Lib/string.py 6 Mar 2003 06:12:15 -0000 *************** *** 86,108 **** return s.strip(chars) # Strip leading tabs and spaces ! def lstrip(s): ! """lstrip(s) -> string Return a copy of the string s with leading whitespace removed. """ ! return s.lstrip() # Strip trailing tabs and spaces ! def rstrip(s): ! """rstrip(s) -> string ! Return a copy of the string s with trailing whitespace ! removed. """ ! return s.rstrip() # Split a string into a list of space/tab-separated words --- 86,109 ---- return s.strip(chars) # Strip leading tabs and spaces ! def lstrip(s, chars=None): ! """lstrip(s [,chars]) -> string Return a copy of the string s with leading whitespace removed. + If chars is given and not None, remove characters in sep instead. """ ! return s.lstrip(chars) # Strip trailing tabs and spaces ! def rstrip(s, chars=None): ! """rstrip(s [,chars]) -> string ! Return a copy of the string s with trailing whitespace removed. ! If chars is given and not None, remove characters in sep instead. """ ! return s.rstrip(chars) # Split a string into a list of space/tab-separated words Index: Objects/stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.205 diff -c -r2.205 stringobject.c *** Objects/stringobject.c 29 Jan 2003 17:58:45 -0000 2.205 --- Objects/stringobject.c 6 Mar 2003 06:12:17 -0000 *************** *** 1770,1781 **** 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"); static PyObject * string_strip(PyStringObject *self, PyObject *args) --- 1770,1781 ---- PyDoc_STRVAR(strip__doc__, ! "S.strip([chars]) -> string or unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is unicode, S will be converted to unicode before stripping"); static PyObject * string_strip(PyStringObject *self, PyObject *args) *************** *** 1788,1798 **** 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"); static PyObject * string_lstrip(PyStringObject *self, PyObject *args) --- 1788,1798 ---- PyDoc_STRVAR(lstrip__doc__, ! "S.lstrip([chars]) -> string or unicode\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is unicode, S will be converted to unicode before stripping"); static PyObject * string_lstrip(PyStringObject *self, PyObject *args) *************** *** 1805,1815 **** 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"); static PyObject * string_rstrip(PyStringObject *self, PyObject *args) --- 1805,1815 ---- PyDoc_STRVAR(rstrip__doc__, ! "S.rstrip([chars]) -> string or unicode\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is unicode, S will be converted to unicode before stripping"); static PyObject * string_rstrip(PyStringObject *self, PyObject *args) Index: Objects/unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.182 diff -c -r2.182 unicodeobject.c *** Objects/unicodeobject.c 11 Feb 2003 23:05:37 -0000 2.182 --- Objects/unicodeobject.c 6 Mar 2003 06:12:19 -0000 *************** *** 5246,5257 **** 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"); static PyObject * unicode_strip(PyUnicodeObject *self, PyObject *args) --- 5246,5257 ---- PyDoc_STRVAR(strip__doc__, ! "S.strip([chars]) -> unicode\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is a str, it will be converted to unicode before stripping"); static PyObject * unicode_strip(PyUnicodeObject *self, PyObject *args) *************** *** 5264,5274 **** 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"); static PyObject * unicode_lstrip(PyUnicodeObject *self, PyObject *args) --- 5264,5274 ---- PyDoc_STRVAR(lstrip__doc__, ! "S.lstrip([chars]) -> unicode\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is a str, it will be converted to unicode before stripping"); static PyObject * unicode_lstrip(PyUnicodeObject *self, PyObject *args) *************** *** 5281,5291 **** 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"); static PyObject * unicode_rstrip(PyUnicodeObject *self, PyObject *args) --- 5281,5291 ---- PyDoc_STRVAR(rstrip__doc__, ! "S.rstrip([chars]) -> unicode\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ ! If chars is given and not None, remove characters in chars instead.\n\ ! If chars is a str, it will be converted to unicode before stripping"); static PyObject * unicode_rstrip(PyUnicodeObject *self, PyObject *args)