[New-bugs-announce] [issue6049] str.strip() and " behaviour expected?

Erik Bernoth report at bugs.python.org
Sun May 17 20:48:56 CEST 2009


New submission from Erik Bernoth <sholvar at gmx.net>:

Hey guys,

is the following behaviour expected? I don't really think so...

$ python
Python 3.0.1 (r301:69597, Feb 14 2009, 19:03:52) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> 
>>> 
>>> s = ' "Peter"'
>>> s
' "Peter"'
>>> s.strip()
'"Peter"'
>>> s.strip('"')
' "Peter'
>>> s.strip('\"')
' "Peter'
>>> s.strip('\"\"')
' "Peter'
>>> 
>>> 
>>> 
>>> s.strip()
'"Peter"'
>>> s.strip().strip('"')
'Peter'
>>> s.strip('"').strip()
'"Peter'

----------
components: Library (Lib), Macintosh
messages: 87999
nosy: sholvar
severity: normal
status: open
title: str.strip() and " behaviour expected?
versions: Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6049>
_______________________________________


More information about the New-bugs-announce mailing list