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

Add primitives for strip(), rstrip() and lstrip() #1090

Open
JukkaL opened this issue Feb 19, 2025 · 1 comment · May be fixed by python/mypy#18742
Open

Add primitives for strip(), rstrip() and lstrip() #1090

JukkaL opened this issue Feb 19, 2025 · 1 comment · May be fixed by python/mypy#18742

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Feb 19, 2025

The str method strip is very popular, and the close relatives lstrip and rstrip are also used commonly. It would be good to have efficient primitives for them. I think there is no Python C API for these, but maybe we can adapt _PyUnicode_XStrip from CPython. Writing our own implementation wouldn't be too difficult either.

@advait-dixit
Copy link

Will work on this over the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants