@@ -380,13 +380,12 @@ def PermutationGroup(gens=None, *args, **kwds):
380
380
...
381
381
TypeError: gens must be a tuple, list, or GapElement
382
382
383
- This will raise an error after the deprecation period ::
383
+ This now raises an error (:issue:`31510`) ::
384
384
385
385
sage: G = PermutationGroup([(1,2,3,4)], [(1,7,3,5)])
386
- doctest:warning
386
+ Traceback (most recent call last):
387
387
...
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
390
389
"""
391
390
if not isinstance (gens , ExpectElement ) and hasattr (gens , '_permgroup_' ):
392
391
return gens ._permgroup_ ()
@@ -402,18 +401,7 @@ def PermutationGroup(gens=None, *args, **kwds):
402
401
raise ValueError ("you must specify the domain for an action" )
403
402
return PermutationGroup_action (gens , action , domain , gap_group = gap_group )
404
403
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" )
417
405
return PermutationGroup_generic (gens = gens , gap_group = gap_group , domain = domain ,
418
406
canonicalize = canonicalize , category = category )
419
407
@@ -1068,7 +1056,7 @@ def list(self):
1068
1056
"""
1069
1057
return list (self )
1070
1058
1071
- def __contains__ (self , item ):
1059
+ def __contains__ (self , item ) -> bool :
1072
1060
"""
1073
1061
Return whether ``item`` is an element of this group.
1074
1062
@@ -1105,33 +1093,6 @@ def __contains__(self, item):
1105
1093
return False
1106
1094
return True
1107
1095
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
-
1135
1096
def __iter__ (self ):
1136
1097
r"""
1137
1098
Return an iterator going through all elements in ``self``.
@@ -1161,9 +1122,9 @@ def __iter__(self):
1161
1122
"""
1162
1123
if len (self ._gens ) == 1 :
1163
1124
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' )
1167
1128
1168
1129
def _iteration_monogen (self ):
1169
1130
r"""
0 commit comments