2828
2929 # 3. the syntax to describe several validation functions at once
3030 VFDefinitionElement = Union [str , Type [ValidationFailure ], ValidationCallableOrLambda ]
31- """This type represents one of the elements that can define a checker"""
31+ """This type represents one of the elements that can define a checker: help msg, failure type, callable """
3232
3333 OneOrSeveralVFDefinitions = Union [ValidationFuncDefinition ,
3434 Iterable [ValidationFuncDefinition ],
@@ -61,7 +61,7 @@ class FunctionDefinitionError(Exception):
6161
6262supported_syntax = 'a callable, a tuple(callable, help_msg_str), a tuple(callable, failure_type), ' \
6363 'tuple(callable, help_msg_str, failure_type), or a list of ' \
64- 'several such elements. Tuples indicate an implicit `failure_raiser`. ' \
64+ 'several such elements. Dicts are supported too. Tuples indicate an implicit `failure_raiser`. ' \
6565 '[mini_lambda](https://smarie.github.io/python-mini-lambda/) expressions can be used instead of ' \
6666 'callables, they will be transformed to functions automatically.'
6767
@@ -233,7 +233,7 @@ def make_validation_func_callables(*vf_definition, # type: OneO
233233
234234 :param vf_definition: the base validation function or list of base validation functions to use. A callable, a
235235 tuple(callable, help_msg_str), a tuple(callable, failure_type), tuple(callable, help_msg_str, failure_type)
236- or a list of several such elements.
236+ or a list of several such elements. A dict can also be used (see doc).
237237 Tuples indicate an implicit `failure_raiser`.
238238 [mini_lambda](https://smarie.github.io/python-mini-lambda/) expressions can be used instead
239239 of callables, they will be transformed to functions automatically.
@@ -246,7 +246,7 @@ def make_validation_func_callables(*vf_definition, # type: OneO
246246
247247 # handle the case where vf_definition is not yet a list or is empty or none
248248 if len (vf_definition ) == 0 :
249- raise ValueError ('mandatory vf_definition is None ' )
249+ raise ValueError ('No validation function definition was provided ' )
250250 elif len (vf_definition ) == 1 :
251251 # a single item has been received. If it is not a tuple, use it: it might be a list or dict
252252 single_entry = vf_definition [0 ]
0 commit comments