Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a natural method of sorting #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

2 participants