"""
Permutations
============

A simple implementation of permutations on `n` elements.

Authors
-------

* Chris Swierczewski (Feb 2014)
"""

class Permutation(object):
    """A permutation on `n` elements.

    Methods
    -------
    is_identity()
        Returns `True` if the Permutation is the identity.
    index(j)
        Representing the Permutation in "map" notation, a list where `i`
        is mapped to `j = lst[i]`, returns `i`. That is, the preimage of
        `j`.
    action(a)
        Returns the permutation of an iterable `a` under the action of