Skip to content

Commit 1310d8a

Browse files
committed
cache the result of _libgap_() in PermutationGroup
This fixes weird sage: S = SymmetricGroup(4) sage: g1 = S._libgap_() sage: g2 = S._libgap_() sage: g1.IsIdenticalObj(g2) false (one gets true now)
1 parent 5dfc256 commit 1310d8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sage/groups/perm_gps/permgroup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,8 @@ def gap(self):
684684
"""
685685
if self._libgap is not None:
686686
return self._libgap
687-
return super()._libgap_()
687+
self._libgap = super()._libgap_()
688+
return self._libgap
688689

689690
# Override the default _libgap_ to use the caching as self._libgap
690691
_libgap_ = gap

0 commit comments

Comments
 (0)