Feat: rename var_list to template

This commit is contained in:
Bertrand Benjamin 2021-10-09 08:32:00 +02:00
parent aad2395a3a
commit b43c64fc7e

View File

@ -19,7 +19,7 @@ DEFAUTL_CONFIG = {
def list_generator( def list_generator(
var_list: list[str], template: list[str],
conditions: list[str] = [], conditions: list[str] = [],
global_config: dict = {}, global_config: dict = {},
configs: dict = {}, configs: dict = {},
@ -56,9 +56,9 @@ def list_generator(
>>> a not in [2, 3, 5, 7] >>> a not in [2, 3, 5, 7]
True True
""" """
rv = extract_letters(var_list) rv = extract_letters(template)
rv_gen = random_generator( rv_gen = random_generator(
rv, conditions, dict(DEFAUTL_CONFIG, **global_config), configs rv, conditions, dict(DEFAUTL_CONFIG, **global_config), configs
) )
generated = eval_words(var_list, rv_gen) generated = eval_words(template, rv_gen)
return [generated[v] for v in var_list] return [generated[v] for v in template]