I find that with natsort.natsorted the sorting order changes part-way through a string:
In [31]: import natsort as ns
In [32]: ns.natsorted(["01-08", "02-07", "01-06", "02-09"])
Out[32]: ['01-08', '01-06', '02-09', '02-07']
In this case, the behaviour I want is:
In [33]: sorted(["01-08", "02-07", "01-06", "02-09"])
Out[33]: ['01-06', '01-08', '02-07', '02-09']
ns.versortedseems to have the behaviour I'm looking for, but I wish to use it on paths, and other strings, not versions. Is that recommended use? - user2561747versortedwithns.PATHwithout any issue at all. - SethMMortonns.INT | ns.UNSIGNED | ns.PATH, orns.I | ns.U | ns.P. - SethMMortonnatsortanymore for all but special cases. Simply usingns.natsorted(["01-08", "02-07", "01-06", "02-09"])works as expected now. - SethMMorton