natsort
natsort copied to clipboard
Comparisons incorrect on leading zeros
The comment says:
The longest run of digits wins. That aside, the greatest value wins, but we can't know that it will until we've scanned both numbers to know that they have the same magnitude, so we remember it in BIAS.
It should be the "longest run of digits ignoring leading zeros wins". E.g., given:
5
8
007
It should sort as 5, 007, 8 and not as 5, 8, 007.
Please note that I'm responding just based on a quick look at the source code.