Lines Matching refs:self

67     def __str__(self):
68 if self.x == m.inf:
70 elif self.x == -m.inf:
73 return str(self.x)
75 def __int__(self):
76 assert not m.isinf(self.x)
77 return self.x
79 def __float__(self):
80 return float(self.x)
83 def table(self):
84 return '%7s' % (self,)
89 def diff_diff(self, other):
90 new = self.x if self else 0
100 def ratio(self, other):
101 new = self.x if self else 0
116 def __add__(self, other):
117 return self.__class__(self.x + other.x)
119 def __sub__(self, other):
120 return self.__class__(self.x - other.x)
122 def __mul__(self, other):
123 return self.__class__(self.x * other.x)
145 def __str__(self):
146 if self.x == m.inf:
148 elif self.x == -m.inf:
151 return '%.1f' % self.x
153 def __float__(self):
154 return float(self.x)
178 def __str__(self):
179 return '%s/%s' % (self.a, self.b)
181 def __float__(self):
182 return float(self.a)
185 def table(self):
186 t = self.a.x/self.b.x if self.b.x else 1.0
188 self,
194 def diff_table(self):
195 return '%11s' % (self,)
197 def diff_diff(self, other):
198 new_a, new_b = self if self else (Int(0), Int(0))
204 def ratio(self, other):
205 new_a, new_b = self if self else (Int(0), Int(0))
211 def __add__(self, other):
212 return self.__class__(self.a + other.a, self.b + other.b)
214 def __sub__(self, other):
215 return self.__class__(self.a - other.a, self.b - other.b)
217 def __mul__(self, other):
218 return self.__class__(self.a * other.a, self.b + other.b)
220 def __lt__(self, other):
221 self_t = self.a.x/self.b.x if self.b.x else 1.0
223 return (self_t, self.a.x) < (other_t, other.a.x)
225 def __gt__(self, other):
226 return self.__class__.__lt__(other, self)
228 def __le__(self, other):
229 return not self.__gt__(other)
231 def __ge__(self, other):
232 return not self.__lt__(other)
320 def __add__(self, other):
321 return self.__class__(
322 **{k: getattr(self, k) for k in by},
323 **{k: object.__getattribute__(self, k)
327 def __getattribute__(self, k):
329 if object.__getattribute__(self, k):
330 return ops.get(k, OPS['sum'])(object.__getattribute__(self, k))
333 return object.__getattribute__(self, k)
765 def __call__(self, parser, namespace, value, option):