1
0
Fork 0
pre-commit/testing/auto_namedtuple.py

12 lines
338 B
Python
Raw Normal View History

import collections
def auto_namedtuple(classname='auto_namedtuple', **kwargs):
"""Returns an automatic namedtuple object.
Args:
classname - The class name for the returned object.
**kwargs - Properties to give the returned object.
"""
return (collections.namedtuple(classname, kwargs.keys())(**kwargs))