[Python-Dev] str.lstrip bug?

2015-03-12 Thread Stephen J. Turnbull
lou xiao writes: I find a bug in str.lstrip, when i call str.lstrip, i get this result. a.lstrip('device_') 'nfo' Try a.lstrip('_ecived') You'll see that you get the same result. I suspect that you misunderstand the meaning of the argument, which is not a sequence of

Re: [Python-Dev] str.lstrip bug?

2015-03-12 Thread Isaac Schwabacher
On 15-03-10, Facundo Batista wrote: On Tue, Mar 10, 2015 at 2:27 PM, lou xiao lox.x...@gmail.com wrote: tiny➜ ~ python Python 2.7.5+ (default, Feb 27 2014, 19:37:08) [GCC 4.8.1] on linux2 Type help, copyright, credits or license for more information. a='device_info'

Re: [Python-Dev] str.lstrip bug?

2015-03-10 Thread Facundo Batista
On Tue, Mar 10, 2015 at 2:27 PM, lou xiao lox.x...@gmail.com wrote: tiny➜ ~ python Python 2.7.5+ (default, Feb 27 2014, 19:37:08) [GCC 4.8.1] on linux2 Type help, copyright, credits or license for more information. a='device_info' a.lstrip('device') '_info' a.lstrip('device_') 'nfo' On

Re: [Python-Dev] str.lstrip bug?

2015-03-10 Thread Chris Angelico
On Wed, Mar 11, 2015 at 4:27 AM, lou xiao lox.x...@gmail.com wrote: I find a bug in str.lstrip, when i call str.lstrip, i get this result. tiny➜ ~ python Python 2.7.5+ (default, Feb 27 2014, 19:37:08) [GCC 4.8.1] on linux2 Type help, copyright, credits or license for more information.

Re: [Python-Dev] str.lstrip bug?

2015-03-10 Thread lou xiao
ths, i misunderstood the method 2015-03-11 1:33 GMT+08:00 Chris Angelico ros...@gmail.com: On Wed, Mar 11, 2015 at 4:27 AM, lou xiao lox.x...@gmail.com wrote: I find a bug in str.lstrip, when i call str.lstrip, i get this result. tiny➜ ~ python Python 2.7.5+ (default, Feb 27 2014,

Re: [Python-Dev] str.lstrip bug?

2015-03-10 Thread Florian Bruhin
* lou xiao lox.x...@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 --

[Python-Dev] str.lstrip bug?

2015-03-10 Thread lou xiao
I find a bug in str.lstrip, when i call str.lstrip, i get this result. tiny➜ ~ python Python 2.7.5+ (default, Feb 27 2014, 19:37:08) [GCC 4.8.1] on linux2 Type help, copyright, credits or license for more information. a='device_info' a.lstrip('device') '_info' a.lstrip('device_') 'nfo' tiny➜

Re: [Python-Dev] str.lstrip bug?

2015-03-10 Thread Isaac Schwabacher
On 15-03-10, Ethan Furman wrote: On 03/10/2015 10:57 AM, Isaac Schwabacher wrote: On 15-03-10, Facundo Batista wrote: On Tue, Mar 10, 2015 at 2:27 PM, lou xiao wrote: tiny➜ ~ python Python 2.7.5+ (default, Feb 27 2014, 19:37:08) [GCC 4.8.1] on linux2 Type help, copyright, credits

Re: [Python-Dev] str.lstrip bug?

2015-03-10 Thread Ethan Furman
On 03/10/2015 10:57 AM, Isaac Schwabacher wrote: On 15-03-10, Facundo Batista wrote: On Tue, Mar 10, 2015 at 2:27 PM, lou xiao wrote: tiny➜ ~ python Python 2.7.5+ (default, Feb 27 2014, 19:37:08) [GCC 4.8.1] on linux2 Type help, copyright, credits or license for more information.