[Python-Dev] str.lstrip bug?

Florian Bruhin me at the-compiler.org
Tue Mar 10 18:34:34 CET 2015


* lou xiao <lox.xiao at gmail.com> [2015-03-11 01:27:21 +0800]:
> I find a bug in str.lstrip, when i call str.lstrip, i get this result.

You're misunderstanding how str.strip works. It takes a set of
characters and removes them all from the beginning:

    >>> "abababcd".lstrip('ab')
    >>> 'cd'

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150310/e6de258b/attachment.sig>


More information about the Python-Dev mailing list