Skip to content

Commit

Permalink
Ignore duplication linting warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph-Edwards committed Nov 21, 2024
1 parent 3c9ea33 commit 1f9bad3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 10 additions & 3 deletions libsemigroups_pybind11/froidure_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ class FroidurePin(CxxWrapper): # pylint: disable=missing-class-docstring
# C++ FroidurePin special methods
########################################################################

def __init__( # pylint: disable=super-init-not-called
# TODO(1): This __init__ is identical to the SchreierSims __init__. It would
# probably be best to make an abstract base class from which all classes
# that construct using a list of generators inherit.
def __init__( # pylint: disable=super-init-not-called, duplicate-code
self: Self, *args
) -> None:
if len(args) == 0:
Expand Down Expand Up @@ -154,10 +157,14 @@ def __iter__(self: Self) -> Iterator:
########################################################################

def current_elements(self: Self) -> Iterator:
return map(lambda x: to_py(self.Element, x), self._cxx_obj.current_elements())
return map(
lambda x: to_py(self.Element, x), self._cxx_obj.current_elements()
)

def idempotents(self: Self) -> Iterator:
return map(lambda x: to_py(self.Element, x), self._cxx_obj.idempotents())
return map(
lambda x: to_py(self.Element, x), self._cxx_obj.idempotents()
)

def sorted_elements(self: Self) -> Iterator:
return map(
Expand Down
5 changes: 4 additions & 1 deletion libsemigroups_pybind11/schreier_sims.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ class SchreierSims(CxxWrapper): # pylint: disable=missing-class-docstring
# C++ Constructors
########################################################################

def __init__( # pylint: disable=super-init-not-called
# TODO(1): This __init__ is identical to the FroidurePin __init__. It would
# probably be best to make an abstract base class from which all classes
# that construct using a list of generators inherit.
def __init__( # pylint: disable=super-init-not-called, duplicate-code
self: Self, *args
) -> None:
if len(args) == 0:
Expand Down

0 comments on commit 1f9bad3

Please sign in to comment.