@@ -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