Changes between Version 2 and Version 3 of Ticket #17890, comment 21


Ignore:
Timestamp:
04/25/15 15:41:02 (7 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17890, comment 21

    v2 v3  
    33>
    44> 1. In the documentation of `sage.structure.element` emphasize what should be done for Python classes as well (and the potential difference between Python and Cython). It is not very clear to me!
    5 Unfortunately, it is not very clear to me either. In particular, I don't find good Python documentation about the interaction between `__cmp__`, rich comparisons like `__eq__` and `__hash__` and what Python does when you call `cmp(x,y)`. It seems that `cmp(x,y)` only calls `x.__cmp__(y)` when `x` and `y` have the same type, but I don't find this anywhere documented.
     5Unfortunately, it is not very clear to me either. In particular, I don't find good Python documentation about the interaction between `__cmp__`, rich comparisons like `__eq__` and `__hash__` and what Python does when you call `cmp(x,y)`. It seems that `cmp(x,y)` only calls `x.__cmp__(y)` when `x` and `y` have the same type, but I don't find this anywhere documented. And I know that inheritance works in a strange way for comparisons, but I also don't quite know how.