'Generates a random permutation of length ``n``.
Uses the underlying Python pseudo-random number generator.
Examples
>>> from sympy.combinatorics.permutations import Permutation
>>> Permutation.random(2) in (Permutation([1, 0]), Permutation([0, 1]))
True'

@classmethod
def random(cls, n):

    perm_array = list(range(n))
    random.shuffle(perm_array)
    return cls._af_new(perm_array)
