Skip to content

Commit

Permalink
docs: natural sort snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdt committed Jul 2, 2024
1 parent 7a015e6 commit 88ee41f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/actionsheets/data/python/collections/list.toml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ code = "x.sort(reverse=True)"
what = "Sort on transformed elements, ascending"
code = "x.sort(key=str.lower)"

[update.order.sort.natural]
what = "Naturally sort string elements"
code = """
from natsort import natsorted
natsorted(x)
"""
details = "E.g., sort as ['abc1', 'abc2', 'abc10']. Uses the natsort package."

[update.order.shuffle]
what = "Shuffle elements"
code = "random.shuffle(x)"
Expand Down

0 comments on commit 88ee41f

Please sign in to comment.