import re


def parse_params(path):
    """Parse a path fragment and convert to a list of tuples.
    Slashes separate alternating keys and values.
    For example /a/3/b/5 -> [ ['a', '3'], ['b', '5'] ]."""
    parts = re.split('/',path)
    keys = parts[:-1:2]
    values= parts[1::2]
    return zip(keys,values)