mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fix logging.getLevelName() type hints (#2730)
`logging.getLevelName()` can take either an `int` and returns a `str` or a `str` and returns an `int` when the level name (`str`) or level (`int`) is one of the registered log levels. If the value passed in isn't one of the registered log levels, it returns the string `"level %s" % lvl` where `lvl` is the value passed in to the function.
This commit is contained in:
committed by
Sebastian Rittau
parent
78690405cf
commit
e8c1111d13
@@ -348,7 +348,7 @@ fatal = critical
|
||||
|
||||
def disable(lvl: int) -> None: ...
|
||||
def addLevelName(lvl: int, levelName: str) -> None: ...
|
||||
def getLevelName(lvl: int) -> str: ...
|
||||
def getLevelName(lvl: Union[int, str]) -> Any: ...
|
||||
|
||||
def makeLogRecord(attrdict: Mapping[str, Any]) -> LogRecord: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user