Re: pretty strange behavior of "strip"

2008-12-08 Thread Tim Roberts
Guy Doune <[EMAIL PROTECTED]> wrote: >Ok, didn't show the whole problem... > >I will read the doc anyway, but why "questions.html" keep it "t"?? > > >>> test=['03.html', '06.html', 'questions.html', '04.html', >'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html'] > >>> test[4] >'toc

Re: pretty strange behavior of "strip" FORGET THE LAST ONE

2008-12-05 Thread Scott David Daniels
Guy Doune wrote: Guy Doune a écrit : Ok, didn't show the whole problem... I will read the doc anyway, but why "questions.html" keep it "t"?? >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html'] >>> test[4] 'toc.html

Re: pretty strange behavior of "strip"

2008-12-05 Thread rdmurray
On Fri, 5 Dec 2008 at 07:54, Mark Tolonen wrote: > > import re > > re.split('[,.]','blah,blah.blah') ['blah', 'blah', 'blah'] Thank you. Somehow it never occurred to me that I could use that kind of pattern that way. I guess my brain just doesn't think in regexes very well :) --RDM -- htt

Re: pretty strange behavior of "strip"

2008-12-05 Thread MRAB
[EMAIL PROTECTED] wrote: On Thu, 4 Dec 2008 at 20:54, Terry Reedy wrote: 'toc.html' > > > test[4].strip('.html') 'oc' Can't figure out what is going on, really. What I can't figure out is why, when people cannot figure out what is going on with a function (or methods in this case), they

Re: pretty strange behavior of "strip"

2008-12-05 Thread Mark Tolonen
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Thu, 4 Dec 2008 at 20:54, Terry Reedy wrote: [snip] I have often wished that in 'split' I could specify a _set_ of characters on which the string would be split, in the same way the default list of whitespace characters causes a s

Re: pretty strange behavior of "strip"

2008-12-05 Thread rdmurray
On Thu, 4 Dec 2008 at 20:54, Terry Reedy wrote: 'toc.html' > > > test[4].strip('.html') 'oc' Can't figure out what is going on, really. What I can't figure out is why, when people cannot figure out what is going on with a function (or methods in this case), they do not look it up the doc.

Re: pretty strange behavior of "strip"

2008-12-05 Thread Mark Tolonen
"Guy Doune" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Ok, didn't show the whole problem... I will read the doc anyway, but why "questions.html" keep it "t"?? >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', '05.html', '07.html', '02.html'

Re: pretty strange behavior of "strip" FORGET THE LAST ONE

2008-12-05 Thread Guy Doune
Guy Doune a écrit : Ok, didn't show the whole problem... I will read the doc anyway, but why "questions.html" keep it "t"?? >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html'] >>> test[4] 'toc.html' >>> test[4].stri

Re: pretty strange behavior of "strip"

2008-12-05 Thread Guy Doune
Ok, didn't show the whole problem... I will read the doc anyway, but why "questions.html" keep it "t"?? >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html'] >>> test[4] 'toc.html' >>> test[4].strip('.html') 'oc' >>> tes

Re: pretty strange behavior of "strip"

2008-12-04 Thread Terry Reedy
Guy Doune wrote: Hi everybody, Could it be a bug? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html',

Re: pretty strange behavior of "strip"

2008-12-04 Thread MRAB
Guy Doune wrote: Hi everybody, Could it be a bug? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html',

Re: pretty strange behavior of "strip"

2008-12-04 Thread James Mills
On Fri, Dec 5, 2008 at 9:35 AM, Guy Doune <[EMAIL PROTECTED]> wrote: test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html'] test > ['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', > '05.htm

Re: pretty strange behavior of "strip"

2008-12-04 Thread Ned Deily
In article <[EMAIL PROTECTED]>, Guy Doune <[EMAIL PROTECTED]> wrote: > Could it be a bug? > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> test=['03.html', '06.h

Re: pretty strange behavior of "strip"

2008-12-04 Thread Robert Kern
Guy Doune wrote: Hi everybody, Could it be a bug? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html',

pretty strange behavior of "strip"

2008-12-04 Thread Guy Doune
Hi everybody, Could it be a bug? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', '05.html