Skip to content

Instantly share code, notes, and snippets.

@AdamBrouwersHarries
Created February 22, 2016 12:09
Show Gist options
  • Save AdamBrouwersHarries/31ae3ee8482254b1a48b to your computer and use it in GitHub Desktop.
Save AdamBrouwersHarries/31ae3ee8482254b1a48b to your computer and use it in GitHub Desktop.
def updatedict(fails, d, k, m):
f = fails
fc = "failcount"
f[d] = f.get(d, dict())
f[d][k] = f[d].get(k, dict())
f[d][k][m] = f[d][k].get(m, dict())
f[d][k][m][fc] = f[d][k][m].get(fc, 0) + 1
return f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment