mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Added the useful thinking bit of the autoupdate and tests.
This commit is contained in:
parent
d8f8f5e1f4
commit
49da1ba72a
5 changed files with 144 additions and 8 deletions
11
testing/auto_namedtuple.py
Normal file
11
testing/auto_namedtuple.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue