def strict_dict(pairs):
    """Creates a dict from a sequence of key-value pairs, verifying uniqueness of each key."""
    d = {}
    for k,v in pairs:
        if k in d:
            raise ValueError("duplicate tupkey '%s'" % k)
        d[k] = v
    return d