@@ -805,3 +806,43 @@ def the_func(*args, **kwargs):
return the_func
return deprecate_func
+
+def default_namedtuple(name, fields, doc=""):
+ """Create a namedtuple class
+
+ The difference between a namedtuple class and this class is that default
+ values may be specified for fields and fields with missing values on
+ initialization being initialized to None.
+
+ :param str name: name of the new class
+ :param fields: field descriptions - an iterable of either "name" or
("name", default_value)
+ :type fields: list of str or (str, object) objects
+ :param str doc: the docstring for the new class (should at least describe the
meanings and
+ types of fields)
+
Please add return to documentation string ideally with type of return.
--
To view this pull request on github, visit
https://github.com/rhinstaller/blivet/pull/268#discussion_r43857732