1
0
Fork 0
pre-commit/testing/auto_namedtuple.py
Daniel Baumann 3396d2e509
Merging upstream version 2.18.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-09 21:33:11 +01:00

13 lines
374 B
Python

from __future__ import annotations
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))