From: Christian Caremoli <> Date: Fri, 16 Nov 2007 13:00:57 +0000 (+0000) Subject: CCAR: ajout __cmp__ pour parametre X-Git-Tag: V1_13b1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a328dc15dbb34897a3cb73516e903b0568ed2ce;p=modules%2Feficas.git CCAR: ajout __cmp__ pour parametre --- 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,