We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
natsort 3.5.2, python 3.2.3
>>> l=["li1-1", "li1-2", "li1-3", "li1-10", "li2-11", "li10-1", "li2-11b", "li2-11a", "li2-1b11", "li2-1b2"] >>> natsort.natsorted(l) ['li1-10', 'li1-3', 'li1-2', 'li1-1', 'li2-11', 'li2-11a', 'li2-11b', 'li2-1b2', 'li2-1b11', 'li10-1']
But I expected the result:
['li1-1', 'li1-2', 'li1-3', 'li1-10', 'li2-1b2', 'li2-1b11', 'li2-11', 'li2-11a', 'li2-11b', 'li10-1']
The text was updated successfully, but these errors were encountered:
Use either versorted(l) or natsorted(l, alg=ns.UNSIGNED). Please see the 3rd example here: https://github.com/SethMMorton/natsort#quick-description.
versorted(l)
natsorted(l, alg=ns.UNSIGNED)
Sorry, something went wrong.
Aha, I didn't see my case as version numbers, but yes, it works perfecly. Thanks!
@exostor As of natsort version 4.0.0, you don't need to use versorted or ns.UNSIGNED anymore.
natsort
versorted
ns.UNSIGNED
No branches or pull requests
natsort 3.5.2, python 3.2.3
But I expected the result:
The text was updated successfully, but these errors were encountered: