Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Created April 28, 2016 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PuercoPop/6a1392fada7498137731d881f6a79c75 to your computer and use it in GitHub Desktop.
Save PuercoPop/6a1392fada7498137731d881f6a79c75 to your computer and use it in GitHub Desktop.
def parse_year_month(year_month):
return year_month.split("-")
def find_teams_that_disappeared_in_month(year_month):
current_year, current_month = parse_year_month(year_month)
if current_month == "01": # O is_january(current_month)
return frozenset()
previous_month = month_before(current_month)
current_teams = teams_in_month(current_month)
previous_teams = teams_in_month(previous_month)
return previous_teams - current_teams
# Si entendi mal y no es cada enero sino 2006-01 es el epoch
def find_teams_that_disappeared_in_month(year_month):
if is_epoch(year_month): # O en su defecto months_since_epoch(year_month) > 0:
return frozenset()
previous_month = month_before(current_month)
current_teams = teams_in_month(current_month)
previous_teams = teams_in_month(previous_month)
return previous_teams - current_teams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment