Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions src/sage/combinat/skew_tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def __eq__(self, other):

INPUT:

``other`` -- the element that ``self`` is compared to
- ``other`` -- the element that ``self`` is compared to

OUTPUT:

A Boolean.
A boolean.

TESTS::

Expand All @@ -161,6 +161,10 @@ def __eq__(self, other):
False
sage: t == SkewTableaux()([[None,1,2]])
True
sage: t == [(None,1,2)]
True
sage: t == [[None,1,2]]
True

sage: s = SkewTableau([[1,2]])
sage: s == 0
Expand All @@ -171,7 +175,7 @@ def __eq__(self, other):
if isinstance(other, (Tableau, SkewTableau)):
return list(self) == list(other)
else:
return list(self) == other
return list(self) == other or list(list(row) for row in self) == other

def __ne__(self, other):
r"""
Expand All @@ -181,22 +185,33 @@ def __ne__(self, other):

INPUT:

``other`` -- the element that ``self`` is compared to
- ``other`` -- the element that ``self`` is compared to

OUTPUT:

A Boolean.
A boolean.

TESTS::

sage: t = Tableau([[2,3],[1]])
sage: t = SkewTableau([[None,1,2]])
sage: t != []
True
"""
if isinstance(other, (Tableau, SkewTableau)):
return list(self) != list(other)
else:
return list(self) != other
return not (self == other)

def __hash__(self):
"""
Return the hash of ``self``.

EXAMPLES:

Check that :trac:`35137` is fixed::

sage: t = SkewTableau([[None,1,2]])
sage: hash(t) == hash(tuple(t))
True
"""
return hash(tuple(self))

def check(self):
r"""
Expand Down