On Friday 15 November 2002 06:59 pm, Fred L. Drake wrote: > The maintenance version of the documentation has been updated: > > http://www.python.org/dev/doc/maint22/ > > Small updates. > Add embarrassing note about sneaky feeping creaturism: > The "chars" argument to str.strip(), .lstrip(), and .rstrip(), as > well as the str.zfill() method, were all added in Python 2.2.2! > Woe to over-eager backporters! The string module docstrings for lstrip and rstrip need updating as well then. It looks like only strip has been updated so far. And it would be good if this argument was called the same thing in the string type as in the string module. The one calls it `sep` and the other `chars`. In fact, the docstring for string.strip mixes the two: def strip(s, chars=None): """strip(s [,chars]) -> string Return a copy of the string s with leading and trailing whitespace removed. If chars is given and not None, remove characters in sep instead. If chars is unicode, S will be converted to unicode before stripping. """ return s.strip(chars) The docstring for the type still calls it `sep`, as does lstrip and rstrip: 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"); It looks like the documentation is consistent in calling it `chars`, but the implementation is lagging behind. -- Patrick K. O'Brien Orbtech http://www.orbtech.com/web/pobrien ----------------------------------------------- "Your source for Python programming expertise." -----------------------------------------------
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