Skip to content

Commit ba6576b

Browse files
author
Sylvain MARIE
committed
Minor: comments / docstring edits
1 parent 978ae56 commit ba6576b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

valid8/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def failure_raiser(validation_callable, # type: ValidationCallableOrLambda
484484
# type: (...) -> ValidationCallable
485485
"""
486486
Wraps the provided validation function so that in case of failure it raises the given `failure_type` or a
487-
`WrappingFailure` with the given help message.
487+
`ValidationFailure` with the given help message.
488488
489489
>>> import sys, pytest
490490
>>> if sys.version_info < (3, 0):
@@ -517,8 +517,8 @@ def failure_raiser(validation_callable, # type: ValidationCallableOrLambda
517517
valid8.base.InvalidValue: x should be smaller than 3. Function [x < 3] returned [False] for value 11.
518518
519519
:param validation_callable:
520-
:param failure_type: an optional subclass of `WrappingFailure` that should be raised in case of failure, instead of
521-
`WrappingFailure`.
520+
:param failure_type: an optional subclass of `ValidationFailure` that should be raised in case of failure, instead
521+
of `ValidationFailure`.
522522
:param help_msg: an optional string help message for the raised failure.
523523
:param kw_context_args: optional context arguments for the custom failure message
524524
:return:

valid8/common_syntax.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def make_validation_func_callable(vf_definition, # type: Valid
100100
in case of success. If it is a mini-lambda expression it will automatically be transformed into a function using
101101
`mini_lambda.as_function`. See `ValidationCallable` type hint.
102102
- `<err_msg>` should be a string
103-
- `<failure_type>` should be a subclass of `WrappingFailure`
103+
- `<failure_type>` should be a subclass of `ValidationFailure`
104104
105105
:param vf_definition: the definition for a validation function. One of <validation_func>,
106106
(<validation_func>, <err_msg>), (<validation_func>, <err_type>), or (<validation_func>, <err_msg>, <err_type>)
@@ -248,7 +248,7 @@ def make_validation_func_callables(*vf_definition, # type: OneO
248248
if len(vf_definition) == 0:
249249
raise ValueError('mandatory vf_definition is None')
250250
elif len(vf_definition) == 1:
251-
# a single item has been received. If it is not a tuple, unpack it
251+
# 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]
253253
if not isinstance(single_entry, tuple):
254254
vf_definition = single_entry

0 commit comments

Comments
 (0)