class documentation
class NamedTupleProperties: (source)
Collection of properties used to construct a namedtuple.
Class Method | from |
Make a NamedTupleProperties from field names with no types. |
Method | validate |
Validate and rename self.fields. |
Class Variable | bases |
Undocumented |
Class Variable | fields |
Undocumented |
Class Variable | name |
Undocumented |
Validate and rename self.fields. namedtuple field names have some requirements: - must not be a Python keyword - must consist of only alphanumeric characters and "_" - must not start with "_" or a digit Basically, they're valid Python identifiers that don't start with "_" or a digit. Also, there can be no duplicate field names. If rename is true, any invalid field names are changed to "_%d". For example, "abc def ghi abc" becomes "abc _1 def _3" because "def" is a keyword and "abc" is a duplicate. Also validates self.name, which has the same requirements, except it can start with "_", and cannot be changed.