Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv21002/Lib Modified Files: UserString.py Log Message: Partially implement SF feature request 444708. Add optional arg to string methods strip(), lstrip(), rstrip(). The optional arg specifies characters to delete. Also for UserString. Still to do: - Misc/NEWS - LaTeX docs (I did the docstrings though) - Unicode methods, and Unicode support in the string methods. Index: UserString.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/UserString.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** UserString.py 15 May 2001 11:58:05 -0000 1.10 --- UserString.py 13 Apr 2002 00:56:08 -0000 1.11 *************** *** 109,113 **** def ljust(self, width): return self.__class__(self.data.ljust(width)) def lower(self): return self.__class__(self.data.lower()) ! def lstrip(self): return self.__class__(self.data.lstrip()) def replace(self, old, new, maxsplit=-1): return self.__class__(self.data.replace(old, new, maxsplit)) --- 109,113 ---- def ljust(self, width): return self.__class__(self.data.ljust(width)) def lower(self): return self.__class__(self.data.lower()) ! def lstrip(self, sep=None): return self.__class__(self.data.lstrip(sep)) def replace(self, old, new, maxsplit=-1): return self.__class__(self.data.replace(old, new, maxsplit)) *************** *** 117,121 **** return self.data.rindex(sub, start, end) def rjust(self, width): return self.__class__(self.data.rjust(width)) ! def rstrip(self): return self.__class__(self.data.rstrip()) def split(self, sep=None, maxsplit=-1): return self.data.split(sep, maxsplit) --- 117,121 ---- return self.data.rindex(sub, start, end) def rjust(self, width): return self.__class__(self.data.rjust(width)) ! def rstrip(self, sep=None): return self.__class__(self.data.rstrip(sep)) def split(self, sep=None, maxsplit=-1): return self.data.split(sep, maxsplit) *************** *** 123,127 **** def startswith(self, prefix, start=0, end=sys.maxint): return self.data.startswith(prefix, start, end) ! def strip(self): return self.__class__(self.data.strip()) def swapcase(self): return self.__class__(self.data.swapcase()) def title(self): return self.__class__(self.data.title()) --- 123,127 ---- def startswith(self, prefix, start=0, end=sys.maxint): return self.data.startswith(prefix, start, end) ! def strip(self, sep=None): return self.__class__(self.data.strip(sep)) def swapcase(self): return self.__class__(self.data.swapcase()) def title(self): return self.__class__(self.data.title())
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4