Skip to content

Commit

Permalink
Resolve error in transversal_matroid.pyx
Browse files Browse the repository at this point in the history
An error appears on Python 3.12 due to the default value of an argument of a cpdef function being ``[]``. We now use ``None`` instead.
  • Loading branch information
gmou3 committed Jan 28, 2025
1 parent dc99dc8 commit 919fc34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sage/matroids/transversal_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ cdef class TransversalMatroid(BasisExchangeMatroid):
labels.append(l)
return TransversalMatroid(sets, groundset=self.groundset(), set_labels=labels)

cpdef transversal_extension(self, element=None, newset=False, sets=[]):
cpdef transversal_extension(self, element=None, newset=False, sets=None):
r"""
Return a :class:`TransversalMatroid` extended by an element.
Expand Down Expand Up @@ -751,6 +751,8 @@ cdef class TransversalMatroid(BasisExchangeMatroid):
Transversal matroid of rank 3 on 5 elements, with 3 sets
sage: Ne = N.transversal_extension(element='f', sets=['s2'])
"""
if sets is None:
sets = []
cdef set parsed_sets = set(sets)
if element is None:
element = newlabel(self._groundset)
Expand Down

0 comments on commit 919fc34

Please sign in to comment.