Skip to content

Instantly share code, notes, and snippets.

@rystsov
Created September 18, 2015 05:59
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 rystsov/1517327d88eb3576ef94 to your computer and use it in GitHub Desktop.
Save rystsov/1517327d88eb3576ef94 to your computer and use it in GitHub Desktop.
def cas_update(old, new):
def change(x):
if x!=old: raise Conflict(x)
return new
return change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment