Changes between Version 12 and Version 13 of Ticket #10130


Ignore:
Timestamp:
Apr 29, 2015, 3:18:18 PM (8 years ago)
Author:
Jeroen Demeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10130 – Description

    v12 v13  
    11There are a number of confusing and non-optimal features of the way Sage currently handles hashing and comparison.
    22
    3  * Because of Python, if you override one of these functions, you must redefine the others as well.  This is easy to forget and confuses new users.
    4  * The comparison infrastructure in sage.structure.element predates cpdef, and could be made far less confusing with cpdef => see #17890.
    5  * hashes of parents are used extensively in the coercion framework, so speed is quite important.  But since parents are usually written in Python, the current model will always have at least a dictionary lookup (for example, in finding a cached `self.__hash`).  And often parents don't override the default hashing code and they fall back to slow `__repr__` methods.
     3 * Because of Python, if you override one of these functions, you must redefine the others as well.  This is easy to forget and confuses new users.  For Cython classes, this can be fixed in #18329.
     4
     5 * hashes of parents are used extensively in the coercion framework, so speed is quite important.  But since parents are usually written in Python, the current model will always have at least a dictionary lookup (for example, in finding a cached `self.__hash`).  And often parents don't override the default hashing code and they fall back to slow `__repr__` methods. Fixed by #715???