@@ -4,7 +4,7 @@ from collections.abc import Callable, Hashable, Iterable, Mapping, Sequence
44from configparser import RawConfigParser
55from re import Pattern
66from threading import Thread
7- from typing import IO , Any , Final , Literal , SupportsIndex , TypedDict , overload
7+ from typing import IO , Any , Final , Literal , SupportsIndex , TypedDict , overload , type_check_only
88from typing_extensions import Required , TypeAlias
99
1010from . import Filter , Filterer , Formatter , Handler , Logger , _FilterType , _FormatStyle , _Level
@@ -14,24 +14,28 @@ RESET_ERROR: Final[int] # undocumented
1414IDENTIFIER : Final [Pattern [str ]] # undocumented
1515
1616if sys .version_info >= (3 , 11 ):
17+ @type_check_only
1718 class _RootLoggerConfiguration (TypedDict , total = False ):
1819 level : _Level
1920 filters : Sequence [str | _FilterType ]
2021 handlers : Sequence [str ]
2122
2223else :
24+ @type_check_only
2325 class _RootLoggerConfiguration (TypedDict , total = False ):
2426 level : _Level
2527 filters : Sequence [str ]
2628 handlers : Sequence [str ]
2729
30+ @type_check_only
2831class _LoggerConfiguration (_RootLoggerConfiguration , TypedDict , total = False ):
2932 propagate : bool
3033
3134_FormatterConfigurationTypedDict = TypedDict (
3235 "_FormatterConfigurationTypedDict" , {"class" : str , "format" : str , "datefmt" : str , "style" : _FormatStyle }, total = False
3336)
3437
38+ @type_check_only
3539class _FilterConfigurationTypedDict (TypedDict ):
3640 name : str
3741
@@ -43,6 +47,7 @@ _FilterConfiguration: TypeAlias = _FilterConfigurationTypedDict | dict[str, Any]
4347# Handler config can have additional keys even when not providing a custom factory so we just use `dict`.
4448_HandlerConfiguration : TypeAlias = dict [str , Any ]
4549
50+ @type_check_only
4651class _DictConfigArgs (TypedDict , total = False ):
4752 version : Required [Literal [1 ]]
4853 formatters : dict [str , _FormatterConfiguration ]
0 commit comments