Skip to content
Snippets Groups Projects
Commit f87fbb9f authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

docstring

parent 692fb787
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,12 @@ def _adjust(q):
def typednamedtuple(cls_name, *arg_name_type):
"""
Returns a new subclass of tuple with named fields.
Fields will be coerced to type passed in the pair.
Parameters are tuples of (field name, class/constructor as callable/1)
"""
fieldnames = _nth(arg_name_type, 0)
typeops = _nth(arg_name_type, 1)
MyCls = namedtuple(cls_name, fieldnames)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment