Skip to content

Instantly share code, notes, and snippets.

@seansummers
Created April 30, 2024 20:06
Show Gist options
  • Save seansummers/f6cfb1282de91eb2bfb09cfe3c8675ba to your computer and use it in GitHub Desktop.
Save seansummers/f6cfb1282de91eb2bfb09cfe3c8675ba to your computer and use it in GitHub Desktop.
Python Test Code
from typing import List
def most_recent_first(versions: List[str]) -> List[str]:
"""Return the list of SemVers sorted by the newest first.
>>> versions = ['0.1.0','3.2.1','2.2.3','0.1.1','2.15.3']
>>> most_recent_first(versions)
['3.2.1', '2.15.3', '2.2.3', '0.1.1', '0.1.0']
"""
import doctest
doctest.testmod()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment