From 3a036b64fc09f87b254da84d6f538ec05596588d Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Thu, 30 Nov 2023 22:48:54 +0100 Subject: [PATCH] `logging`: Remove hack obsoleted by PEP 655 (#11078) --- stdlib/logging/config.pyi | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/stdlib/logging/config.pyi b/stdlib/logging/config.pyi index d2d79cfde..0a61e5b16 100644 --- a/stdlib/logging/config.pyi +++ b/stdlib/logging/config.pyi @@ -5,7 +5,7 @@ from configparser import RawConfigParser from re import Pattern from threading import Thread from typing import IO, Any, overload -from typing_extensions import Literal, SupportsIndex, TypeAlias, TypedDict +from typing_extensions import Literal, Required, SupportsIndex, TypeAlias, TypedDict from . import Filter, Filterer, Formatter, Handler, Logger, _FilterType, _FormatStyle, _Level @@ -50,7 +50,8 @@ _FilterConfiguration: TypeAlias = _FilterConfigurationTypedDict | dict[str, Any] # Handler config can have additional keys even when not providing a custom factory so we just use `dict`. _HandlerConfiguration: TypeAlias = dict[str, Any] -class _OptionalDictConfigArgs(TypedDict, total=False): +class _DictConfigArgs(TypedDict, total=False): + version: Required[Literal[1]] formatters: dict[str, _FormatterConfiguration] filters: dict[str, _FilterConfiguration] handlers: dict[str, _HandlerConfiguration] @@ -59,9 +60,6 @@ class _OptionalDictConfigArgs(TypedDict, total=False): incremental: bool disable_existing_loggers: bool -class _DictConfigArgs(_OptionalDictConfigArgs, TypedDict): - version: Literal[1] - # Accept dict[str, Any] to avoid false positives if called with a dict # type, since dict types are not compatible with TypedDicts. #