error in string module documentation?
Oliver Sakki
hyperi at hyperi.org
Sat Apr 19 04:26:36 EDT 2003
Well lstrip takes leading whitespaces away, so another way to fix it would
be 'item = cmd.lstrip()' ? :o)
/-
/- Oliver Sakki (oliver.sakki at hyperi.org)
/- http://www.hyperi.org/
/-
On 19 Apr 2003, Michael Anckaert wrote:
> Hello all,
> In the string module documentation I read the following:
>
>
> lstrip(s[, chars])
> Return a copy of the string with leading characters removed. If
> chars is omitted or None, whitespace characters are removed. If
> given and not None, chars must be a string; the characters in
> the string will be stripped from the beginning of the string
> this method is called on.
>
> But I get the following error from my program:
>
> File "./game.py", line 35, in run_game
> item = string.lstrip(cmd, "look")
> TypeError: lstrip() takes exactly 1 argument (2 given)
>
> Is there an error in the documentation or is it my error?
>
> --
> Greetings,
> Michael Anckaert, aka The XanTor
> OpenPGP key: F7A6C3AB
> Fingerprint: A329 43FC 3953 A944 5DDC 2E05 8E5D AD60 F7A6 C3AB
>
More information about the Python-list
mailing list