Coverage for pydantic/class_validators.py: 100.00%

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

168 statements  

1import warnings linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

2from collections import ChainMap linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

3from functools import wraps linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

4from itertools import chain linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

5from types import FunctionType linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

6from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union, overload linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

7 

8from .errors import ConfigError linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

9from .typing import AnyCallable linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

10from .utils import ROOT_KEY, in_ipython linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

11 

12if TYPE_CHECKING: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

13 from .typing import AnyClassMethod 

14 

15 

16class Validator: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

17 __slots__ = 'func', 'pre', 'each_item', 'always', 'check_fields', 'skip_on_failure' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

18 

19 def __init__( linux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

20 self, 

21 func: AnyCallable, 

22 pre: bool = False, 

23 each_item: bool = False, 

24 always: bool = False, 

25 check_fields: bool = False, 

26 skip_on_failure: bool = False, 

27 ): 

28 self.func = func linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

29 self.pre = pre linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

30 self.each_item = each_item linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

31 self.always = always linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

32 self.check_fields = check_fields linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

33 self.skip_on_failure = skip_on_failure linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

34 

35 

36if TYPE_CHECKING: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

37 from inspect import Signature 

38 

39 from .config import BaseConfig 

40 from .fields import ModelField 

41 from .types import ModelOrDc 

42 

43 ValidatorCallable = Callable[[Optional[ModelOrDc], Any, Dict[str, Any], ModelField, Type[BaseConfig]], Any] 

44 ValidatorsList = List[ValidatorCallable] 

45 ValidatorListDict = Dict[str, List[Validator]] 

46 

47_FUNCS: Set[str] = set() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

48VALIDATOR_CONFIG_KEY = '__validator_config__' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

49ROOT_VALIDATOR_CONFIG_KEY = '__root_validator_config__' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

50 

51 

52def validator( linux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

53 *fields: str, 

54 pre: bool = False, 

55 each_item: bool = False, 

56 always: bool = False, 

57 check_fields: bool = True, 

58 whole: bool = None, 

59 allow_reuse: bool = False, 

60) -> Callable[[AnyCallable], 'AnyClassMethod']: 

61 """ 

62 Decorate methods on the class indicating that they should be used to validate fields 

63 :param fields: which field(s) the method should be called on 

64 :param pre: whether or not this validator should be called before the standard validators (else after) 

65 :param each_item: for complex objects (sets, lists etc.) whether to validate individual elements rather than the 

66 whole object 

67 :param always: whether this method and other validators should be called even if the value is missing 

68 :param check_fields: whether to check that the fields actually exist on the model 

69 :param allow_reuse: whether to track and raise an error if another validator refers to the decorated function 

70 """ 

71 if not fields: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

72 raise ConfigError('validator with no fields specified') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

73 elif isinstance(fields[0], FunctionType): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

74 raise ConfigError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

75 "validators should be used with fields and keyword arguments, not bare. " # noqa: Q000 

76 "E.g. usage should be `@validator('<field_name>', ...)`" 

77 ) 

78 

79 if whole is not None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

80 warnings.warn( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

81 'The "whole" keyword argument is deprecated, use "each_item" (inverse meaning, default False) instead', 

82 DeprecationWarning, 

83 ) 

84 assert each_item is False, '"each_item" and "whole" conflict, remove "whole"' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

85 each_item = not whole linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

86 

87 def dec(f: AnyCallable) -> 'AnyClassMethod': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

88 f_cls = _prepare_validator(f, allow_reuse) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

89 setattr( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

90 f_cls, 

91 VALIDATOR_CONFIG_KEY, 

92 ( 

93 fields, 

94 Validator(func=f_cls.__func__, pre=pre, each_item=each_item, always=always, check_fields=check_fields), 

95 ), 

96 ) 

97 return f_cls linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

98 

99 return dec linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

100 

101 

102@overload linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

103def root_validator(_func: AnyCallable) -> 'AnyClassMethod': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

104 ... 

105 

106 

107@overload linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

108def root_validator( linux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

109 *, pre: bool = False, allow_reuse: bool = False, skip_on_failure: bool = False 

110) -> Callable[[AnyCallable], 'AnyClassMethod']: 

111 ... 

112 

113 

114def root_validator( linux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

115 _func: Optional[AnyCallable] = None, *, pre: bool = False, allow_reuse: bool = False, skip_on_failure: bool = False 

116) -> Union['AnyClassMethod', Callable[[AnyCallable], 'AnyClassMethod']]: 

117 """ 

118 Decorate methods on a model indicating that they should be used to validate (and perhaps modify) data either 

119 before or after standard model parsing/validation is performed. 

120 """ 

121 if _func: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

122 f_cls = _prepare_validator(_func, allow_reuse) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

123 setattr( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

124 f_cls, ROOT_VALIDATOR_CONFIG_KEY, Validator(func=f_cls.__func__, pre=pre, skip_on_failure=skip_on_failure) 

125 ) 

126 return f_cls linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

127 

128 def dec(f: AnyCallable) -> 'AnyClassMethod': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

129 f_cls = _prepare_validator(f, allow_reuse) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

130 setattr( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

131 f_cls, ROOT_VALIDATOR_CONFIG_KEY, Validator(func=f_cls.__func__, pre=pre, skip_on_failure=skip_on_failure) 

132 ) 

133 return f_cls linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

134 

135 return dec linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

136 

137 

138def _prepare_validator(function: AnyCallable, allow_reuse: bool) -> 'AnyClassMethod': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

139 """ 

140 Avoid validators with duplicated names since without this, validators can be overwritten silently 

141 which generally isn't the intended behaviour, don't run in ipython (see #312) or if allow_reuse is False. 

142 """ 

143 f_cls = function if isinstance(function, classmethod) else classmethod(function) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

144 if not in_ipython() and not allow_reuse: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

145 ref = f_cls.__func__.__module__ + '.' + f_cls.__func__.__qualname__ linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

146 if ref in _FUNCS: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

147 raise ConfigError(f'duplicate validator function "{ref}"; if this is intended, set `allow_reuse=True`') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

148 _FUNCS.add(ref) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

149 return f_cls linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

150 

151 

152class ValidatorGroup: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

153 def __init__(self, validators: 'ValidatorListDict') -> None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

154 self.validators = validators linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

155 self.used_validators = {'*'} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

156 

157 def get_validators(self, name: str) -> Optional[Dict[str, Validator]]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

158 self.used_validators.add(name) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

159 validators = self.validators.get(name, []) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

160 if name != ROOT_KEY: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

161 validators += self.validators.get('*', []) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

162 if validators: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

163 return {v.func.__name__: v for v in validators} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

164 else: 

165 return None linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

166 

167 def check_for_unused(self) -> None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

168 unused_validators = set( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

169 chain.from_iterable( 

170 (v.func.__name__ for v in self.validators[f] if v.check_fields) 

171 for f in (self.validators.keys() - self.used_validators) 

172 ) 

173 ) 

174 if unused_validators: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

175 fn = ', '.join(unused_validators) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

176 raise ConfigError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

177 f"Validators defined with incorrect fields: {fn} " # noqa: Q000 

178 f"(use check_fields=False if you're inheriting from the model and intended this)" 

179 ) 

180 

181 

182def extract_validators(namespace: Dict[str, Any]) -> Dict[str, List[Validator]]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

183 validators: Dict[str, List[Validator]] = {} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

184 for var_name, value in namespace.items(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

185 validator_config = getattr(value, VALIDATOR_CONFIG_KEY, None) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

186 if validator_config: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

187 fields, v = validator_config linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

188 for field in fields: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

189 if field in validators: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

190 validators[field].append(v) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

191 else: 

192 validators[field] = [v] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

193 return validators linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

194 

195 

196def extract_root_validators(namespace: Dict[str, Any]) -> Tuple[List[AnyCallable], List[Tuple[bool, AnyCallable]]]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

197 from inspect import signature linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

198 

199 pre_validators: List[AnyCallable] = [] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

200 post_validators: List[Tuple[bool, AnyCallable]] = [] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

201 for name, value in namespace.items(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

202 validator_config: Optional[Validator] = getattr(value, ROOT_VALIDATOR_CONFIG_KEY, None) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

203 if validator_config: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

204 sig = signature(validator_config.func) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

205 args = list(sig.parameters.keys()) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

206 if args[0] == 'self': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

207 raise ConfigError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

208 f'Invalid signature for root validator {name}: {sig}, "self" not permitted as first argument, ' 

209 f'should be: (cls, values).' 

210 ) 

211 if len(args) != 2: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

212 raise ConfigError(f'Invalid signature for root validator {name}: {sig}, should be: (cls, values).') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

213 # check function signature 

214 if validator_config.pre: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

215 pre_validators.append(validator_config.func) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

216 else: 

217 post_validators.append((validator_config.skip_on_failure, validator_config.func)) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

218 return pre_validators, post_validators linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

219 

220 

221def inherit_validators(base_validators: 'ValidatorListDict', validators: 'ValidatorListDict') -> 'ValidatorListDict': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

222 for field, field_validators in base_validators.items(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

223 if field not in validators: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

224 validators[field] = [] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

225 validators[field] += field_validators linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

226 return validators linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

227 

228 

229def make_generic_validator(validator: AnyCallable) -> 'ValidatorCallable': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

230 """ 

231 Make a generic function which calls a validator with the right arguments. 

232 

233 Unfortunately other approaches (eg. return a partial of a function that builds the arguments) is slow, 

234 hence this laborious way of doing things. 

235 

236 It's done like this so validators don't all need **kwargs in their signature, eg. any combination of 

237 the arguments "values", "fields" and/or "config" are permitted. 

238 """ 

239 from inspect import signature linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

240 

241 sig = signature(validator) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

242 args = list(sig.parameters.keys()) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

243 first_arg = args.pop(0) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

244 if first_arg == 'self': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

245 raise ConfigError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

246 f'Invalid signature for validator {validator}: {sig}, "self" not permitted as first argument, ' 

247 f'should be: (cls, value, values, config, field), "values", "config" and "field" are all optional.' 

248 ) 

249 elif first_arg == 'cls': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

250 # assume the second argument is value 

251 return wraps(validator)(_generic_validator_cls(validator, sig, set(args[1:]))) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

252 else: 

253 # assume the first argument was value which has already been removed 

254 return wraps(validator)(_generic_validator_basic(validator, sig, set(args))) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

255 

256 

257def prep_validators(v_funcs: Iterable[AnyCallable]) -> 'ValidatorsList': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

258 return [make_generic_validator(f) for f in v_funcs if f] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

259 

260 

261all_kwargs = {'values', 'field', 'config'} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

262 

263 

264def _generic_validator_cls(validator: AnyCallable, sig: 'Signature', args: Set[str]) -> 'ValidatorCallable': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

265 # assume the first argument is value 

266 has_kwargs = False linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

267 if 'kwargs' in args: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

268 has_kwargs = True linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

269 args -= {'kwargs'} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

270 

271 if not args.issubset(all_kwargs): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

272 raise ConfigError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

273 f'Invalid signature for validator {validator}: {sig}, should be: ' 

274 f'(cls, value, values, config, field), "values", "config" and "field" are all optional.' 

275 ) 

276 

277 if has_kwargs: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

278 return lambda cls, v, values, field, config: validator(cls, v, values=values, field=field, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

279 elif args == set(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

280 return lambda cls, v, values, field, config: validator(cls, v) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

281 elif args == {'values'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

282 return lambda cls, v, values, field, config: validator(cls, v, values=values) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

283 elif args == {'field'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

284 return lambda cls, v, values, field, config: validator(cls, v, field=field) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

285 elif args == {'config'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

286 return lambda cls, v, values, field, config: validator(cls, v, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

287 elif args == {'values', 'field'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

288 return lambda cls, v, values, field, config: validator(cls, v, values=values, field=field) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

289 elif args == {'values', 'config'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

290 return lambda cls, v, values, field, config: validator(cls, v, values=values, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

291 elif args == {'field', 'config'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

292 return lambda cls, v, values, field, config: validator(cls, v, field=field, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

293 else: 

294 # args == {'values', 'field', 'config'} 

295 return lambda cls, v, values, field, config: validator(cls, v, values=values, field=field, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

296 

297 

298def _generic_validator_basic(validator: AnyCallable, sig: 'Signature', args: Set[str]) -> 'ValidatorCallable': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

299 has_kwargs = False linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

300 if 'kwargs' in args: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

301 has_kwargs = True linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

302 args -= {'kwargs'} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

303 

304 if not args.issubset(all_kwargs): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

305 raise ConfigError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

306 f'Invalid signature for validator {validator}: {sig}, should be: ' 

307 f'(value, values, config, field), "values", "config" and "field" are all optional.' 

308 ) 

309 

310 if has_kwargs: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

311 return lambda cls, v, values, field, config: validator(v, values=values, field=field, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

312 elif args == set(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

313 return lambda cls, v, values, field, config: validator(v) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

314 elif args == {'values'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

315 return lambda cls, v, values, field, config: validator(v, values=values) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

316 elif args == {'field'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

317 return lambda cls, v, values, field, config: validator(v, field=field) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

318 elif args == {'config'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

319 return lambda cls, v, values, field, config: validator(v, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

320 elif args == {'values', 'field'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

321 return lambda cls, v, values, field, config: validator(v, values=values, field=field) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

322 elif args == {'values', 'config'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

323 return lambda cls, v, values, field, config: validator(v, values=values, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

324 elif args == {'field', 'config'}: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

325 return lambda cls, v, values, field, config: validator(v, field=field, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

326 else: 

327 # args == {'values', 'field', 'config'} 

328 return lambda cls, v, values, field, config: validator(v, values=values, field=field, config=config) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

329 

330 

331def gather_all_validators(type_: 'ModelOrDc') -> Dict[str, 'AnyClassMethod']: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

332 all_attributes = ChainMap(*[cls.__dict__ for cls in type_.__mro__]) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

333 return { linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

334 k: v 

335 for k, v in all_attributes.items() 

336 if hasattr(v, VALIDATOR_CONFIG_KEY) or hasattr(v, ROOT_VALIDATOR_CONFIG_KEY) 

337 }