-
-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #26221: Enable hash for FreeMonoid_class
As in #26162 and other tickets, removing `__eq__` does the job. Also: - use `UniqueRepresentation` instead of `UniqueFactory` for constructing instances of `FreeMonoid`. - clean up caching of subclasses: no need to do this by hand, since they will now inherit from `UniqueRepresentation`. Without this change, there are Python 3 doctest failures in `sage/algebras/lie_algebras`, among other places. For example, {{{ File "src/sage/algebras/lie_algebras/lie_algebra.py", line 1402, in sage .algebras.lie_algebras.lie_algebra.LiftMorphismToAssociative.preimage Failed example: L = LieAlgebra(associative=R) Exception raised: Traceback (most recent call last): File "sage/misc/cachefunc.pyx", line 1000, in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:6175) return self.cache[k] File "sage/misc/weak_dict.pyx", line 706, in sage.misc.weak_dict.WeakValueDictionary.__getitem__ (build/cythonized/sage/misc/weak_dict.c:3538) cdef PyObject* wr = PyDict_GetItemWithError(self, k) TypeError: unhashable type: 'FreeMonoid_class_with_category' ... }}} Part of #24551. URL: https://trac.sagemath.org/26221 Reported by: jhpalmieri Ticket author(s): John Palmieri Reviewer(s): Travis Scrimshaw
- Loading branch information
Showing
3 changed files
with
156 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.