All Samples(2) | Call(2) | Derive(0) | Import(0)

A method to produce a Permutation object from a list; the list is bound to the _array_form attribute, so it must not be modified; this method is meant for internal use only; the list ``a`` is supposed to be generated as a temporary value in a method, so p = Perm._af_new(a) is the only object to hold a reference to ``a``:: Examples ======== (more...)

@staticmethod def _af_new(perm): """A method to produce a Permutation object from a list; the list is bound to the _array_form attribute, so it must not be modified; this method is meant for internal use only; the list ``a`` is supposed to be generated as a temporary value in a method, so p = Perm._af_new(a) is the only object to hold a reference to ``a``:: Examples ======== >>> from sympy.combinatorics.permutations import Perm >>> Perm.print_cyclic = False >>> a = [2,1,3,0] >>> p = Perm._af_new(a) >>> p Permutation([2, 1, 3, 0]) """ p = Basic.__new__(Perm, perm) p._array_form = perm p._size = len(perm) return p

**sympy**(Download)

for element in elements: if commutes_with_gens(element): centralizer_list.append(Permutation._af_new(element)) else: for element in elements:

src/s/y/sympy-0.7.5/sympy/combinatorics/testutil.py

**sympy**(Download)

for element in elements: if commutes_with_gens(element): centralizer_list.append(Permutation._af_new(element)) else: for element in elements: