Skip to content

Instantly share code, notes, and snippets.

@dnene
Created September 3, 2013 06:55
Show Gist options
  • Save dnene/6420467 to your computer and use it in GitHub Desktop.
Save dnene/6420467 to your computer and use it in GitHub Desktop.
client side helper for operator based syntactic sugar to assist lambda creation
>>> import operator
>>> def myop(optype, second): return lambda first: optype(first,second)
...
>>> myop(operator.lt,60)(45)
True
>>> myop(operator.lt,60)(80)
False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment