Skip to content

Commit 12f45c5

Browse files
authored
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 ```
1 parent 7a81bd4 commit 12f45c5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

stdlib/logging/__init__.pyi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,14 @@ class Logger(Filterer):
290290
def hasHandlers(self) -> bool: ...
291291
def callHandlers(self, record: LogRecord) -> None: ... # undocumented
292292

293-
CRITICAL: Literal[50]
294-
FATAL: Literal[50]
295-
ERROR: Literal[40]
296-
WARNING: Literal[30]
297-
WARN: Literal[30]
298-
INFO: Literal[20]
299-
DEBUG: Literal[10]
300-
NOTSET: Literal[0]
293+
CRITICAL: int
294+
FATAL: int
295+
ERROR: int
296+
WARNING: int
297+
WARN: int
298+
INFO: int
299+
DEBUG: int
300+
NOTSET: int
301301

302302
class Handler(Filterer):
303303
level: int # undocumented

0 commit comments

Comments
 (0)