geneticengine.grammar.metahandlers.vars
Module Contents
Classes
VarRange([a, b, c]) represents the alternative between a, b, and c. |
Attributes
- 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:
depth (int)
context (dict[str, str])
- __repr__()
- classmethod __class_getitem__(args)