diff --git a/src/sage/combinat/partition.py b/src/sage/combinat/partition.py index 6b8b2f669e4..590b0df65e5 100644 --- a/src/sage/combinat/partition.py +++ b/src/sage/combinat/partition.py @@ -4027,15 +4027,12 @@ def outside_corners(self): sage: Partition([]).outside_corners() [(0, 0)] """ - p = self - if p.is_empty(): + p = self._list + if not p: return [(0,0)] - res = [ (0, p[0]) ] - for i in range(1, len(p)): - if p[i-1] != p[i]: - res.append((i,p[i])) + res = [(0, p[0])] + res.extend((n, j) for n, (i, j) in enumerate(zip(p[:-1], p[1:]), start=1) if i != j) res.append((len(p), 0)) - return res addable_cells = outside_corners # for compatibility with partition tuples