Coverage for pydantic/config.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

70 statements  

1import json 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 enum import Enum 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 typing import TYPE_CHECKING, Any, Callable, Dict, ForwardRef, Optional, Tuple, Type, Union 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

4 

5from .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

6from .utils import GetterDict 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 

8if 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

9 from typing import overload 

10 

11 import typing_extensions 

12 

13 from .fields import ModelField 

14 from .main import BaseModel 

15 

16 ConfigType = Type['BaseConfig'] 

17 

18 class SchemaExtraCallable(typing_extensions.Protocol): 

19 @overload 

20 def __call__(self, schema: Dict[str, Any]) -> None: 

21 pass 

22 

23 @overload 

24 def __call__(self, schema: Dict[str, Any], model_class: Type[BaseModel]) -> None: 

25 pass 

26 

27else: 

28 SchemaExtraCallable = Callable[..., 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

29 

30__all__ = 'BaseConfig', 'Extra', 'inherit_config', 'prepare_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

31 

32 

33class Extra(str, Enum): 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 allow = 'allow' 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

35 ignore = 'ignore' 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

36 forbid = 'forbid' 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 

38 

39class BaseConfig: 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

40 title: Optional[str] = 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

41 anystr_lower: bool = 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

42 anystr_strip_whitespace: bool = 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

43 min_anystr_length: int = 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

44 max_anystr_length: Optional[int] = 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

45 validate_all: bool = 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

46 extra: Extra = Extra.ignore 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

47 allow_mutation: bool = 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-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

48 frozen: bool = 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

49 allow_population_by_field_name: bool = 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

50 use_enum_values: bool = 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

51 fields: Dict[str, Union[str, Dict[str, str]]] = {} 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

52 validate_assignment: bool = 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

53 error_msg_templates: Dict[str, str] = {} 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

54 arbitrary_types_allowed: bool = 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

55 orm_mode: bool = 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

56 getter_dict: Type[GetterDict] = GetterDict 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

57 alias_generator: Optional[Callable[[str], str]] = 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

58 keep_untouched: Tuple[type, ...] = () 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

59 schema_extra: Union[Dict[str, Any], 'SchemaExtraCallable'] = {} 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

60 json_loads: Callable[[str], Any] = json.loads 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

61 json_dumps: Callable[..., str] = json.dumps 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

62 json_encoders: Dict[Union[Type[Any], str, ForwardRef], 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

63 underscore_attrs_are_private: bool = 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

64 

65 # whether inherited models as fields should be reconstructed as base model 

66 copy_on_model_validation: bool = 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-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

67 # whether `Union` should check all allowed types before even trying to coerce 

68 smart_union: bool = 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

69 

70 @classmethod 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

71 def get_field_info(cls, name: str) -> Dict[str, Any]: 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 """ 

73 Get properties of FieldInfo from the `fields` property of the config class. 

74 """ 

75 

76 fields_value = cls.fields.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

77 

78 if isinstance(fields_value, str): 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

79 field_info: Dict[str, Any] = {'alias': fields_value} 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

80 elif isinstance(fields_value, dict): 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

81 field_info = fields_value 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

82 else: 

83 field_info = {} 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

84 

85 if 'alias' in field_info: 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

86 field_info.setdefault('alias_priority', 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-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

87 

88 if field_info.get('alias_priority', 0) <= 1 and cls.alias_generator: 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 alias = cls.alias_generator(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-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

90 if not isinstance(alias, str): 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

91 raise TypeError(f'Config.alias_generator must return str, not {alias.__class__}') 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

92 field_info.update(alias=alias, alias_priority=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-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

93 return field_info 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

94 

95 @classmethod 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

96 def prepare_field(cls, field: 'ModelField') -> 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

97 """ 

98 Optional hook to check or modify fields during model creation. 

99 """ 

100 pass linux-py3.7-compiled-no-deps-nolinux-py3.8-compiled-no-deps-nolinux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nolinux-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

101 

102 

103def inherit_config(self_config: 'ConfigType', parent_config: 'ConfigType', **namespace: Any) -> 'ConfigType': 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 if not self_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

105 base_classes: Tuple['ConfigType', ...] = (parent_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

106 elif self_config == parent_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

107 base_classes = (self_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

108 else: 

109 base_classes = self_config, parent_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

110 

111 namespace['json_encoders'] = { 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

112 **getattr(parent_config, 'json_encoders', {}), 

113 **getattr(self_config, 'json_encoders', {}), 

114 **namespace.get('json_encoders', {}), 

115 } 

116 

117 return type('Config', base_classes, namespace) 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

118 

119 

120def prepare_config(config: Type[BaseConfig], cls_name: str) -> 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

121 if not isinstance(config.extra, Extra): 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 try: 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

123 config.extra = Extra(config.extra) 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

124 except ValueError: 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

125 raise ValueError(f'"{cls_name}": {config.extra} is not a valid value for "extra"') 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