Created
May 1, 2015 15:41
-
-
Save inducer/78b0d240b7b4ae8f1bd9 to your computer and use it in GitHub Desktop.
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
def map_comparison(self, expr, *args, **kwargs): | |
return type(expr)( | |
self.rec(expr.left, *args, **kwargs), | |
expr.operator, | |
self.rec(expr.right, *args, **kwargs)) | |
def map_logical_not(self, expr, *args, **kwargs): | |
return type(expr)( | |
self.rec(expr.child, *args, **kwargs)) | |
def map_logical_or(self, expr, *args, **kwargs): | |
return type(expr)(tuple( | |
self.rec(child, *args, **kwargs) for child in expr.children)) | |
map_logical_and = map_logical_or |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment