Natural sorting for python and shell
Natsort lets you apply natural sorting on lists instead of lexicographical. If you use the built-in sorted
method in python on a list such as [
, it would be returned as a20
, a9
, a1
, a4
, a10
][
. Natsort provides a function a1
, a10
, a20
, a4
, a9
]natsorted
that identifies numbers and sorts them separately from strings. It can also sort version numbers, real numbers, mixed types and more, and comes with a shell command natsort
that exposes this functionality in the command line.
Linter | Message | Location |
---|---|---|
optional-tests Make sure tests are only run when requested | the 'check' phase should respect #:tests? | |
formatting Look for formatting issues in the source | line 17611 is way too long (114 characters) | |
formatting Look for formatting issues in the source | line 17612 is way too long (109 characters) |