Skip to content

Commit 556d5f0

Browse files
author
Release Manager
committed
gh-39466: remove some deprecations in groups found using the scripts in #39262 ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: #39466 Reported by: Frédéric Chapoton Reviewer(s): David Coudert
2 parents c22e484 + bc23f92 commit 556d5f0

File tree

5 files changed

+8
-158
lines changed

5 files changed

+8
-158
lines changed

src/doc/en/reference/groups/index.rst

-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ Matrix and Affine Groups
7878
sage/groups/matrix_gps/group_element_gap
7979
sage/groups/matrix_gps/finitely_generated
8080
sage/groups/matrix_gps/finitely_generated_gap
81-
sage/groups/matrix_gps/morphism
82-
sage/groups/matrix_gps/homset
8381
sage/groups/matrix_gps/binary_dihedral
8482
sage/groups/matrix_gps/coxeter_group
8583
sage/groups/matrix_gps/linear

src/sage/groups/matrix_gps/homset.py

-53
This file was deleted.

src/sage/groups/matrix_gps/meson.build

-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ py.install_sources(
99
'group_element.pxd',
1010
'group_element_gap.pxd',
1111
'heisenberg.py',
12-
'homset.py',
1312
'isometries.py',
1413
'linear.py',
1514
'linear_gap.py',
1615
'matrix_group.py',
1716
'matrix_group_gap.py',
18-
'morphism.py',
1917
'named_group.py',
2018
'named_group_gap.py',
2119
'orthogonal.py',

src/sage/groups/matrix_gps/morphism.py

-54
This file was deleted.

src/sage/groups/perm_gps/permgroup.py

+8-47
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,12 @@ def PermutationGroup(gens=None, *args, **kwds):
380380
...
381381
TypeError: gens must be a tuple, list, or GapElement
382382
383-
This will raise an error after the deprecation period::
383+
This now raises an error (:issue:`31510`)::
384384
385385
sage: G = PermutationGroup([(1,2,3,4)], [(1,7,3,5)])
386-
doctest:warning
386+
Traceback (most recent call last):
387387
...
388-
DeprecationWarning: gap_group, domain, canonicalize, category will become keyword only
389-
See https://github.com/sagemath/sage/issues/31510 for details.
388+
ValueError: please use keywords gap_group=, domain=, canonicalize=, category= in the input
390389
"""
391390
if not isinstance(gens, ExpectElement) and hasattr(gens, '_permgroup_'):
392391
return gens._permgroup_()
@@ -402,18 +401,7 @@ def PermutationGroup(gens=None, *args, **kwds):
402401
raise ValueError("you must specify the domain for an action")
403402
return PermutationGroup_action(gens, action, domain, gap_group=gap_group)
404403
if args:
405-
from sage.misc.superseded import deprecation
406-
deprecation(31510, "gap_group, domain, canonicalize, category will become keyword only")
407-
if len(args) > 4:
408-
raise ValueError("invalid input")
409-
args = list(args)
410-
gap_group = args.pop(0)
411-
if args:
412-
domain = args.pop(0)
413-
if args:
414-
canonicalize = args.pop(0)
415-
if args:
416-
category = args.pop(0)
404+
raise ValueError("please use keywords gap_group=, domain=, canonicalize=, category= in the input")
417405
return PermutationGroup_generic(gens=gens, gap_group=gap_group, domain=domain,
418406
canonicalize=canonicalize, category=category)
419407

@@ -1068,7 +1056,7 @@ def list(self):
10681056
"""
10691057
return list(self)
10701058

1071-
def __contains__(self, item):
1059+
def __contains__(self, item) -> bool:
10721060
"""
10731061
Return whether ``item`` is an element of this group.
10741062
@@ -1105,33 +1093,6 @@ def __contains__(self, item):
11051093
return False
11061094
return True
11071095

1108-
def has_element(self, item):
1109-
"""
1110-
Return whether ``item`` is an element of this group -
1111-
however *ignores* parentage.
1112-
1113-
EXAMPLES::
1114-
1115-
sage: G = CyclicPermutationGroup(4)
1116-
sage: gens = G.gens()
1117-
sage: H = DihedralGroup(4)
1118-
sage: g = G([(1,2,3,4)]); g
1119-
(1,2,3,4)
1120-
sage: G.has_element(g)
1121-
doctest:warning
1122-
...
1123-
DeprecationWarning: G.has_element(g) is deprecated; use :meth:`__contains__`, i.e., `g in G` instead
1124-
See https://github.com/sagemath/sage/issues/33831 for details.
1125-
True
1126-
sage: h = H([(1,2),(3,4)]); h
1127-
(1,2)(3,4)
1128-
sage: G.has_element(h)
1129-
False
1130-
"""
1131-
from sage.misc.superseded import deprecation
1132-
deprecation(33831, "G.has_element(g) is deprecated; use :meth:`__contains__`, i.e., `g in G` instead")
1133-
return item in self
1134-
11351096
def __iter__(self):
11361097
r"""
11371098
Return an iterator going through all elements in ``self``.
@@ -1161,9 +1122,9 @@ def __iter__(self):
11611122
"""
11621123
if len(self._gens) == 1:
11631124
return self._iteration_monogen()
1164-
else:
1165-
# TODO: this is too slow for moderatly small permutation groups
1166-
return self.iteration(algorithm='SGS')
1125+
1126+
# TODO: this is too slow for moderately small permutation groups
1127+
return self.iteration(algorithm='SGS')
11671128

11681129
def _iteration_monogen(self):
11691130
r"""

0 commit comments

Comments
 (0)