From 12f45c5efb9e0a9b8a955fcdcdd3cfdd0367cb22 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Tue, 22 Feb 2022 15:24:10 +0000 Subject: [PATCH] Replace some literal types in logging with int (#7354) See #7258 for an extended discussion. In summary, for mypy these would be better written as follows, but this would not work with other type checkers: ``` CRITICAL: Final = 50 ``` --- stdlib/logging/__init__.pyi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index b3f17b943..c860938c3 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -290,14 +290,14 @@ class Logger(Filterer): def hasHandlers(self) -> bool: ... def callHandlers(self, record: LogRecord) -> None: ... # undocumented -CRITICAL: Literal[50] -FATAL: Literal[50] -ERROR: Literal[40] -WARNING: Literal[30] -WARN: Literal[30] -INFO: Literal[20] -DEBUG: Literal[10] -NOTSET: Literal[0] +CRITICAL: int +FATAL: int +ERROR: int +WARNING: int +WARN: int +INFO: int +DEBUG: int +NOTSET: int class Handler(Filterer): level: int # undocumented