Skip to content

Remove hack obsoleted by PEP 655 #11078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions stdlib/logging/config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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]
Expand All @@ -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.
#
Expand Down