-
Notifications
You must be signed in to change notification settings - Fork 779
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
implement PyStringMethods
#3677
Conversation
Makes sense to me. |
CodSpeed Performance ReportMerging #3677 will degrade performances by 33.39%Comparing Summary
Benchmarks breakdown
|
We've had a little bit of flakiness with PyPy 3.8 previously so will retry in the hope it's not caused by this PR. |
Hmm I'll try to investigate this later 🤔 |
I noticed that PyPy 3.8 succeeded in the second run (but failed in the first), so I think this is just the usual PyPy flakiness :( |
For #3382
There are some interesting bits going on in this PR:
to_str
needs the GILPool to work for abi3 before Python 3.10, so I have added a#[cfg]
on the correspondingPyStringMethods
API.to_cow
as a new API inPyStringMethods
which is an alternative for users on abi3 before 3.10 (cc @alex)Py::to_str
,Py::to_cow
andPy::to_string_lossy
as reads which can outlast the GIL lifetime, like we did for bytes (cf GIL-free references to Python data #2275)