(cls, *args, **kwargs)
return obj
The default constructor. Accepts Cycle and Permutation forms.
        Removes duplicates unless ``dups`` keyword is False.
The default constructor. Accepts Cycle and Permutation forms.
        Removes duplicates unless ``dups`` keyword is False.
The default constructor . Accepts Cycle and Permutation forms . Removes duplicates unless dups keyword is False .
def __new__(cls, *args, **kwargs):
        """The default constructor. Accepts Cycle and Permutation forms.
        Removes duplicates unless ``dups`` keyword is False.
        """
        args = list(args[0] if is_sequence(args[0]) else args)
        if not args:
            raise ValueError('must supply one or more permutations '
            'to define the group')
        if any(isinstance(a, Cycle) for a in args):
            args = [Permutation(a) for a in args]
        if has_variety(a.size for a in args):
            degree = kwargs.pop('degree', None)
            if degree is None:
                degree = max(a.size for a in args)
            for i in range(len(args)):
                if args[i].size != degree:
                    args[i] = Permutation(args[i], size=degree)
        if kwargs.pop('dups', True):
            args = list(uniq([_af_new(list(a)) for a in args]))
        obj = Basic.__new__(cls, *args, **kwargs)
        obj._generators = args
        obj._order = None
        obj._center = []
        obj._is_abelian = None
        obj._is_transitive = None
        obj._is_sym = None
        obj._is_alt = None
        obj._is_primitive = None
        obj._is_nilpotent = None
        obj._is_solvable = None
        obj._is_trivial = None
        obj._transitivity_degree = None
        obj._max_div = None
        obj._r = len(obj._generators)
        obj._degree = obj._generators[0].size

        # these attributes are assigned after running schreier_sims
        obj._base = []
        obj._strong_gens = []
        obj._basic_orbits = []
        obj._transversals = []

        # these attributes are assigned after running _random_pr_init
        obj._random_gens = []
        return obj
def __new__ ( cls , * args , * * kwargs ) : args = list ( args [ 0 ] if is_sequence ( args [ 0 ] ) else args ) if not args : raise ValueError ( 'must supply one or more permutations ' 'to define the group' ) if any ( isinstance ( a , Cycle ) for a in args ) : args = [ Permutation ( a ) for a in args ] if has_variety ( a . size for a in args ) : degree = kwargs . pop ( 'degree' , None ) if degree is None : degree = max ( a . size for a in args ) for i in range ( len ( args ) ) : if args [ i ] . size != degree : args [ i ] = Permutation ( args [ i ] , size = degree ) if kwargs . pop ( 'dups' , True ) : args = list ( uniq ( [ _af_new ( list ( a ) ) for a in args ] ) ) obj = Basic . __new__ ( cls , * args , * * kwargs ) obj . _generators = args obj . _order = None obj . _center = [ ] obj . _is_abelian = None obj . _is_transitive = None obj . _is_sym = None obj . _is_alt = None obj . _is_primitive = None obj . _is_nilpotent = None obj . _is_solvable = None obj . _is_trivial = None obj . _transitivity_degree = None obj . _max_div = None obj . _r = len ( obj . _generators ) obj . _degree = obj . _generators [ 0 ] . size # these attributes are assigned after running schreier_sims obj . _base = [ ] obj . _strong_gens = [ ] obj . _basic_orbits = [ ] obj . _transversals = [ ] # these attributes are assigned after running _random_pr_init obj . _random_gens = [ ] return obj