From 8a328dc15dbb34897a3cb73516e903b0568ed2ce Mon Sep 17 00:00:00 2001 From: Christian Caremoli <> Date: Fri, 16 Nov 2007 13:00:57 +0000 Subject: [PATCH] CCAR: ajout __cmp__ pour parametre --- Extensions/param2.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Extensions/param2.py b/Extensions/param2.py index 2546bc22..765dd1e0 100644 --- a/Extensions/param2.py +++ b/Extensions/param2.py @@ -46,6 +46,14 @@ class Formula: def __pow__(self, other): return Binop('**', self, other) def __rpow__(self, other): return Binop('**', other, self) def __getitem__(self,i):return Binop('[]',self,i) + def __cmp__( self, other ): return self.eval().__cmp__(other) + def __eq__( self, other ): return self.eval() == other + def __ne__( self, other ): return self.eval() != other + def __lt__( self, other ): return self.eval() < other + def __le__( self, other ): return self.eval() <= other + def __gt__( self, other ): return self.eval() > other + def __ge__( self, other ): return self.eval() >= other + class Binop(Formula): opmap = { '+': lambda a, b: a + b, -- 2.39.2