Skip to content

Conversation

digitaltommy
Copy link

A combined alphabetical and numerical approach with an answer found on stackoverflow.

See #26 for issue.

…cal approach with an answer found from stackoverflow
https://stackoverflow.com/a/2669120
"""
convert = lambda text: int(text) if text.isdigit() else text
alphanum_key = lambda key: [convert(c) for c in re.split("([0-9]+)", key)]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import re for regular expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants