-
-
Notifications
You must be signed in to change notification settings - Fork 8
Add string comparison support so that x.sort() works #37
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
Conversation
Can we get a test too? |
It occurs to me that it may not be correct to rely on |
Unicode string comparison is tricky. There are lots of edge cases. |
Yep, you're both right - |
681a2a1
to
bce48f6
Compare
After some discussion I've made the choice to sort strings by their UCS4 code points. This is the approach that python takes by default, and if you want the more advanced sorting methods required for unicode comparison, you can use the I still think it would be cool to have vectorized functions for normalization and sorting, but we can introduce those later, since you can't provide the options you would need to do that for |
Besides the inline comment, can you also increment the API version in the other dtypes? You'll need to do that anyway before this is merged to get the tests to pass. |
bce48f6
to
aef38e9
Compare
Thanks for the feedback - I've updated the API versions everywhere. |
This PR builds on numpy/numpy#23173 to provide a
PyArray_CompareFunc
so thatx.sort()
works.I also updated the README with a bit of information about needing the nightly numpy wheel for support, added a note about
--no-build-isolation
, and removed a bit aboutmeson-python
not supporting editable builds (it does now!).This PR remains in draft until numpy/numpy#23173 is merged.