We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea82f65 commit 861093dCopy full SHA for 861093d
src/sage/combinat/posets/hasse_diagram.py
@@ -435,6 +435,8 @@ def bottom(self) -> int | None:
435
sage: Q.bottom()
436
0
437
"""
438
+ if not self:
439
+ return None
440
min_elms = (x for x in self if not self.in_degree(x))
441
bottom = next(min_elms)
442
try:
@@ -472,6 +474,8 @@ def top(self) -> int | None:
472
474
sage: Q.top()
473
475
1
476
477
478
479
max_elms = (x for x in self if not self.out_degree(x))
480
top = next(max_elms)
481
0 commit comments