From ade6103a748ec063bc3d66cab84690f0ae9c4c86 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Mon, 20 Apr 2015 15:41:50 -0500 Subject: [PATCH] Support min(), max() in IdentityMapper --- pymbolic/mapper/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pymbolic/mapper/__init__.py b/pymbolic/mapper/__init__.py index baa0cfc..5485e68 100644 --- a/pymbolic/mapper/__init__.py +++ b/pymbolic/mapper/__init__.py @@ -493,6 +493,12 @@ class IdentityMapper(Mapper): self.rec(expr.then, *args, **kwargs), self.rec(expr.else_, *args, **kwargs)) + def map_min(self, expr, *args, **kwargs): + return type(expr)(tuple( + self.rec(child, *args, **kwargs) for child in expr.children)) + + map_max = map_min + # }}} -- GitLab