Skip to content

Commit 1595f6e

Browse files
author
Sylvain MARIE
committed
A few minor docstring edits + exception message
1 parent 0386528 commit 1595f6e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

valid8/common_syntax.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
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

6262
supported_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]

valid8/entry_points.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def my_validator(x):
515515
516516
:param validation_func: the base validation function or list of base validation functions to use. A callable, a
517517
tuple(callable, help_msg_str), a tuple(callable, failure_type), tuple(callable, help_msg_str, failure_type)
518-
or a list of several such elements.
518+
or a list of several such elements. A dict can also be used (see doc).
519519
Tuples indicate an implicit `failure_raiser`.
520520
[mini_lambda](https://smarie.github.io/python-mini-lambda/) expressions can be used instead
521521
of callables, they will be transformed to functions automatically.

0 commit comments

Comments
 (0)