Changeset 6675:5350e2664296
- Timestamp:
- 09/10/07 13:26:23 (6 years ago)
- Branch:
- default
- Location:
- sage/structure
- Files:
-
- 3 edited
-
coerce.pyx (modified) (3 diffs)
-
coerce_dict.pyx (modified) (2 diffs)
-
element.pyx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sage/structure/coerce.pyx
r6674 r6675 343 343 344 344 cdef coercion_maps_c(self, R, S): 345 homs = self._coercion_maps.get(R, S, None) 346 if homs is None: 345 try: 346 return self._coercion_maps.get(R, S, None) 347 except KeyError: 347 348 homs = self.discover_coercion_c(R, S) 348 349 swap = None if homs is None else (homs[1], homs[0]) … … 355 356 356 357 cdef get_action_c(self, R, S, op): 357 action = self._action_maps.get(R, S, op) 358 if action is None: 358 try: 359 return self._action_maps.get(R, S, op) 360 except KeyError: 359 361 action = self.discover_action_c(R, S, op) 360 362 self._action_maps.set(R, S, op, action) 361 return action363 return action 362 364 363 365 cdef discover_coercion_c(self, R, S): … … 393 395 394 396 cdef discover_action_c(self, R, S, op): 397 # print "looking", R, <int>R, op, S, <int>S 395 398 396 399 if PY_TYPE_CHECK(S, Parent): -
sage/structure/coerce_dict.pyx
r6665 r6675 141 141 except (TypeError,ValueError): 142 142 raise KeyError, k 143 value = self.get(k1, k2, k3) 144 if value is None: 145 raise KeyError, k 146 else: 147 return value 143 return self.get(k1, k2, k3) 148 144 149 145 cdef get(self, k1, k2, k3): … … 157 153 PyList_GET_ITEM(bucket, i+2) == <PyObject*>k3: 158 154 return <object>PyList_GET_ITEM(bucket, i+3) 159 r eturn None155 raise KeyError, (k1, k2, k3) 160 156 161 157 def __setitem__(self, k, value): -
sage/structure/element.pyx
r6672 r6675 875 875 global coercion_model 876 876 return coercion_model.bin_op_c(left, right, mul) 877 #return module_element_generic_multiply_c(left, right)877 # return module_element_generic_multiply_c(left, right) 878 878 879 879 def __imul__(left, right):
Note: See TracChangeset
for help on using the changeset viewer.
