SkewTableaux are not hashable?

29 views
Skip to first unread message

Martin R

unread,
Feb 14, 2023, 1:06:58 PM2/14/23
to sage-devel
sage: hash(SkewTableau([[1]]))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [48], line 1
----> 1 hash(SkewTableau([[Integer(1)]]))

TypeError: unhashable type: 'SkewTableaux_with_category.element_class'

It inherits from ClonableList, I would have thought that this automatically provides a hash.  But of course:

    # __hash__ is not properly inherited if comparison is changed
    # see <http://groups.google.com/group/cython-users/t/e89a9bd2ff20fd5a>

:-(

Martin

Travis Scrimshaw

unread,
Feb 14, 2023, 10:31:54 PM2/14/23
to sage-devel
Hi Martin,
   This happens because it overrides __eq__. It probably would be better to replace it by a __richcmp__ anyways, which might even fix this problem. It has a few easy solutions. I will try to do a PR today for it.

Best,
Travis

Travis Scrimshaw

unread,
Feb 15, 2023, 12:10:22 AM2/15/23
to sage-devel
Reply all
Reply to author
Forward
0 new messages