Message 339235 - Python tracker

Message339235

Author 78Alpha
Recipients 78Alpha, eric.smith, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-03-31.01:02:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAP+xHDz=WTCeyZzwMi87ubJK3izkGhQec4SL49EAqvzV7cHQPA@mail.gmail.com>
In-reply-to <1553985299.22.0.101292588741.issue36480@roundup.psfhosted.org>
Content
I have read the documentation. It didn't function near what I thought it
did. I've never heard it stripping front and back characters in tutorials.

I solely admit I was wrong in assuming its function.

On Sat, Mar 30, 2019, 3:35 PM Eric V. Smith <report@bugs.python.org> wrote:

>
> Eric V. Smith <eric@trueblade.com> added the comment:
>
> I cannot run that example on my computer.
>
> Please reduce this to a single line of code, with no imports, that calls
> .strip() and shows your problem. Ideally you will just use constants, and
> not computed strings.
>
> Something like:
>
> >>> 'magenta.zip'.strip('pizamn')
> 'genta.'
>
> And also, show that exact same line of code executed on both platforms.
>
> That said, the problem is likely in your usage of .strip(). Please re-read
> the documentation: it does not remove substrings from a given string, it
> removes any of the given characters from the beginning and end of the
> string.
>
> So, this is correct:
> >>> 'magenta.zip'.strip('pm')
> 'agenta.zi'
>
> You're probably seeing some difference due to upper or lower case
> filenames on the two platforms.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue36480>
> _______________________________________
>
History
Date User Action Args
2019-03-31 01:02:1378Alphasetrecipients: + 78Alpha, paul.moore, eric.smith, tim.golden, zach.ware, steve.dower
2019-03-31 01:02:1378Alphalinkissue36480 messages
2019-03-31 01:02:1378Alphacreate