permute_sequence

sequencetools.permute_sequence(sequence, permutation)

Permutes sequence.

>>> sequencetools.permute_sequence([10, 11, 12, 13, 14, 15], [5, 4, 0, 1, 2, 3])
[15, 14, 10, 11, 12, 13]

Permutes references to sequence elements; does not copy sequence elements.

Returns new object of sequence type.