pretty strange behavior of "strip"

Terry Reedy tjreedy at
Fri Dec 5 02:54:28 CET 2008

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', '01.html', '05.html', '07.html', '02.html', '08.html']
>  >>> 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'
> 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.  (If you are an exception and did, what confused you?)  Can 
you enlighten me?


More information about the Python-list mailing list