@@ -481,8 +481,9 @@ def latest_validation_failure() -> Optional[ValidationFailure]:
481
481
ValidationFailure([2, 'hi'], list[int],
482
482
ValidationFailure('hi', <class 'int'>)))
483
483
484
- This validation failure information is also set by :func:`is_valid` in case
485
- of failed validation, even though no error is raised.
484
+ This validation failure information is also set by
485
+ :func:`~typing_validation.validation.is_valid` in case of failed validation,
486
+ even though no error is raised.
486
487
"""
487
488
type_err : Optional [TypeError ] = None
488
489
try :
@@ -496,16 +497,18 @@ def latest_validation_failure() -> Optional[ValidationFailure]:
496
497
return get_validation_failure (type_err )
497
498
return latest_validation_failure
498
499
500
+
499
501
_latest_validation_failure : Optional [ValidationFailure ] = None
500
502
503
+
501
504
def _set_latest_validation_failure (
502
- failure : Optional [ValidationFailure ]
503
- ) -> Optional [ValidationFailure ]:
505
+ failure : Optional [ValidationFailure ],
506
+ ) -> Optional [ValidationFailure ]:
504
507
"""
505
508
Sets a new value for ``_latest_validation_failure`` and returns
506
509
the previous value.
507
510
"""
508
- global _latest_validation_failure # pylint: disable = global-statement
511
+ global _latest_validation_failure # pylint: disable = global-statement
509
512
prev_failure = _latest_validation_failure
510
513
_latest_validation_failure = failure
511
514
return prev_failure
0 commit comments