Skip to content

Commit bc92c7e

Browse files
committed
Set "default=-1" for rank of FlatsMatroid
This is for an invalid input with no flats
1 parent c68aec5 commit bc92c7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sage/matroids/flats_matroid.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ cdef class FlatsMatroid(Matroid):
8383
except KeyError:
8484
self._F[i] = set()
8585
self._F[i].add(frozenset(F))
86-
self._matroid_rank = max([0] + list(self._F))
86+
self._matroid_rank = max(self._F, default=-1)
8787

8888
cpdef groundset(self) noexcept:
8989
"""

0 commit comments

Comments
 (0)