Created
September 3, 2013 06:55
-
-
Save dnene/6420467 to your computer and use it in GitHub Desktop.
client side helper for operator based syntactic sugar to assist lambda creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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