(self, *i)
Allows applying a permutation instance as a bijective function.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([[2,0], [3,1]])
        >>> p.array_form
        [2, 3, 0, 1]
        >>> [p(i) for i in range(4)]
        [2, 3, 0, 1]

        If an array is given then the permutation selects the items
        from the array (i.e. the permutation is applied to the array):

        >>> from sympy.abc import x
        >>> p([x, 1, 0, x**2])
        [0, x**2, x, 1]
Allows applying a permutation instance as a bijective function.
Allows applying a permutation instance as a bijective function .
def __call__(self, *i):
        """
        Allows applying a permutation instance as a bijective function.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([[2,0], [3,1]])
        >>> p.array_form
        [2, 3, 0, 1]
        >>> [p(i) for i in range(4)]
        [2, 3, 0, 1]

        If an array is given then the permutation selects the items
        from the array (i.e. the permutation is applied to the array):

        >>> from sympy.abc import x
        >>> p([x, 1, 0, x**2])
        [0, x**2, x, 1]
        """
        # list indices can be Integer or int; leave this
        # as it is (don't test or convert it) because this
        # gets called a lot and should be fast
        if len(i) == 1:
            i = i[0]
            try:
                # P(1)
                return self._array_form[i]
            except TypeError:
                try:
                    # P([a, b, c])
                    return [i[j] for j in self._array_form]
                except:
                    raise TypeError('unrecognized argument')
        else:
            # P(1, 2, 3)
            return self*Permutation(Cycle(*i), size=self.size)
def __call__ ( self , * i ) : # list indices can be Integer or int; leave this # as it is (don't test or convert it) because this # gets called a lot and should be fast if len ( i ) == 1 : i = i [ 0 ] try : # P(1) return self . _array_form [ i ] except TypeError : try : # P([a, b, c]) return [ i [ j ] for j in self . _array_form ] except : raise TypeError ( 'unrecognized argument' ) else : # P(1, 2, 3) return self * Permutation ( Cycle ( * i ) , size = self . size )