Changes between Initial Version and Version 1 of Ticket #19016, comment 99
 Timestamp:
 10/18/15 03:05:44 (5 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

Ticket #19016, comment 99
initial v1 1 1 Replying to [comment:97 jdemeyer]: 2 > 1. In `src/sage/rings/polynomial/laurent_polynomial.pyx`, the function `__hash__` is defined twice in the same class. 3 4 Can you give line numbers? I count only two definitions of `__hash__` in 5 `src/sage/rings/polynomial/laurent_polynomial.pyx`, and they are on distinct classes: 6 {{{ 7 sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_mpair.__hash__ 8 sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_univariate.__hash__ 9 }}} 10 respectively. 11 12 > 2. This isn't proper doctest syntax: 13 14 Thanks; should be fixed. 15 16 > 3. Could you justify the need to add lots of comparison functions? 17 18 Yes, I wonder too. Not including those would save us adding a whole bunch of silly doctests too. 19 20 > 4. Why is this needed? 21 > {{{ 22 > #!diff 23 >  return self.element_class(self, m) 24 > + return self.element_class(self, ZZ(m)) 25 > }}} 26 27 If `self.m` should be an `Integer` this is a good way of enforcing it. I don't think we did this before? perhaps this is covered in `element_class` already. I'm not familiar with this code (and didn't add that patch) 28 2 29 > 5. This looks very suspicious: 3 30 > {{{ … … 16 43 > }}} 17 44 See comment:86 and #19388. 45 46 > 6. Do you really need to add the constantzero hash to the various ideal classes? Isn't it sufficient to add it to the base class `Ideal_generic`? 47 48 I think it's better in the long run for sage if we don't. Having a 0 hash is really bad, but not so easy to diagnose quickly. If it really is too difficult to normalize ideal generators in such a way that one can derive a reliable hash, it's probably better if those ideals are not hashable and hence are not used as dict keys. I think the present "0" hashes are just put in so that we don't break legacy code. Future ring implementations should pay more attention to if and how their ideals can be hashed. The problem is more visible if there is no hash available for ideals by default.