Skip to content

Commit 3a036b6

Browse files
authored
logging: Remove hack obsoleted by PEP 655 (#11078)
1 parent 9fbf2e1 commit 3a036b6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

stdlib/logging/config.pyi

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ from configparser import RawConfigParser
55
from re import Pattern
66
from threading import Thread
77
from typing import IO, Any, overload
8-
from typing_extensions import Literal, SupportsIndex, TypeAlias, TypedDict
8+
from typing_extensions import Literal, Required, SupportsIndex, TypeAlias, TypedDict
99

1010
from . import Filter, Filterer, Formatter, Handler, Logger, _FilterType, _FormatStyle, _Level
1111

@@ -50,7 +50,8 @@ _FilterConfiguration: TypeAlias = _FilterConfigurationTypedDict | dict[str, Any]
5050
# Handler config can have additional keys even when not providing a custom factory so we just use `dict`.
5151
_HandlerConfiguration: TypeAlias = dict[str, Any]
5252

53-
class _OptionalDictConfigArgs(TypedDict, total=False):
53+
class _DictConfigArgs(TypedDict, total=False):
54+
version: Required[Literal[1]]
5455
formatters: dict[str, _FormatterConfiguration]
5556
filters: dict[str, _FilterConfiguration]
5657
handlers: dict[str, _HandlerConfiguration]
@@ -59,9 +60,6 @@ class _OptionalDictConfigArgs(TypedDict, total=False):
5960
incremental: bool
6061
disable_existing_loggers: bool
6162

62-
class _DictConfigArgs(_OptionalDictConfigArgs, TypedDict):
63-
version: Literal[1]
64-
6563
# Accept dict[str, Any] to avoid false positives if called with a dict
6664
# type, since dict types are not compatible with TypedDicts.
6765
#

0 commit comments

Comments
 (0)