geneticengine.grammar.metahandlers.vars

Module Contents

Classes

VarRange

VarRange([a, b, c]) represents the alternative between a, b, and c.

Attributes

T

geneticengine.grammar.metahandlers.vars.T
class geneticengine.grammar.metahandlers.vars.VarRange(options)

Bases: geneticengine.grammar.metahandlers.base.MetaHandlerGenerator

VarRange([a, b, c]) represents the alternative between a, b, and c.

The list of options can be dynamically altered before the grammar extraction with something like Var.__init__.__annotations__[“name”] = Annotated[str, VarRange([d, e, f])]. The option list must not be empty.

Parameters:

options (list[T])

generate(r, g, rec, new_symbol, depth, base_type, context)
Parameters:
__repr__()
classmethod __class_getitem__(args)