month_names = [
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
]
def sort_by_month(month1, month2):
month1_index = month_names.index(month1)
month2_index = month_names.index(month2)
return cmp(month1_index, month2_index)