tri.named_struct package

Module contents

class tri.named_struct.NamedFrozenStruct(*args, **kwargs)[source]

Bases: tri.struct.Frozen, tri.named_struct.NamedStruct

Class extending tri.struct.FrozenStruct to only allow a defined subset of string keys.

classmethod get_declared(parameter='members')

Get the OrderedDict value of the parameter collected by the @declarative class decorator. This is the same value that would be submitted to the __init__ invocation in the members argument (or another name if overridden by the parameter specification) @type cls: class @type parameter: str @return OrderedDict

classmethod set_declared(value, parameter='members')

@type cls: class @type value: OrderedDict @type parameter: str

class tri.named_struct.NamedStruct(*args, **kwargs)[source]

Bases: tri.struct.Struct

Class extending tri.struct.Struct to only allow a defined subset of string keys.

classmethod get_declared(parameter='members')

Get the OrderedDict value of the parameter collected by the @declarative class decorator. This is the same value that would be submitted to the __init__ invocation in the members argument (or another name if overridden by the parameter specification) @type cls: class @type parameter: str @return OrderedDict

classmethod set_declared(value, parameter='members')

@type cls: class @type value: OrderedDict @type parameter: str

class tri.named_struct.NamedStructField(*args, **kwargs)[source]

Bases: object

Field declaration for NamedStruct classes

tri.named_struct.named_frozen_struct(field_names, typename='FrozenNamedStruct')[source]

Procedural way to define a FrozenNamedStruct subclass, similar to the named_tuple builtin.

tri.named_struct.named_struct(field_names, typename='NamedStruct')[source]

Procedural way to define a NamedStruct subclass, similar to the named_tuple builtin.