Skip to content

Instantly share code, notes, and snippets.

@brunobord
Forked from pelletier/gist:1099501
Created July 22, 2011 14:01
Show Gist options
  • Save brunobord/1099506 to your computer and use it in GitHub Desktop.
Save brunobord/1099506 to your computer and use it in GitHub Desktop.
def _cmp(a, b):
# print a, b
if a == b:
return 0
if a.startswith(b) == 0:
return 1
else:
return -1
# my CMP... Comparing the first letter is not enough, IMHO.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment