def NamedTuple(*namelist):
    """Class factory function for creating named tuples."""
    class _NamedTuple(tuple):
        __metaclass__ = NamedTupleMetaclass
        names = list(namelist)

    return _NamedTuple
Class factory function for creating named tuples.
recipes/Python/303481_Tuples_named_elements__using/recipe-303481.py