Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept a function to strip like rstrip and lstrip #31211

Merged
merged 1 commit into from
Mar 4, 2019
Merged

Conversation

ararslan
Copy link
Member

@ararslan ararslan commented Feb 28, 2019

strip is documented to accept a function argument but it does not. rstrip and lstrip do, so it seems this was simply an oversight.

Fixes #31195.

NOTE: #31213 should be merged first!

@nalimilan
Copy link
Member

I'm not sure why but @simonbyrne didn't add that method in #27309 (comment).

@simonbyrne
Copy link
Contributor

I think it was an oversight as that PR got modified.

@@ -53,6 +53,7 @@ end
@test strip(" \u2009 hi \u2009 ") == "hi"
@test strip("foobarfoo", ['f','o']) == "bar"
@test strip("foobarfoo", ('f','o')) == "bar"
@test strip(ispunct, "¡Hola!") == "Hola"
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

`strip` is documented to accept a function argument but it does not.
`rstrip` and `lstrip` do, so it seems this was simply an oversight.

See #31195.
@fredrikekre fredrikekre merged commit 79fd332 into master Mar 4, 2019
@fredrikekre fredrikekre deleted the aa/strip-pred branch March 4, 2019 08:23
@sbromberger
Copy link
Contributor

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:strings "Strings!"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants