class documentation

class NamedTupleProperties: (source)

View In Hierarchy

Collection of properties used to construct a namedtuple.

Class Method from_field_names Make a NamedTupleProperties from field names with no types.
Method validate_and_rename_fields Validate and rename self.fields.
Class Variable bases Undocumented
Class Variable fields Undocumented
Class Variable name Undocumented
@classmethod
def from_field_names(cls, name, field_names, ctx): (source)

Make a NamedTupleProperties from field names with no types.

def validate_and_rename_fields(self, rename): (source)

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.

Undocumented

Undocumented

Undocumented