Skip to content

Commit

Permalink
Fix logging.getLevelName() type hints (python#2730)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
noseworthy authored and Jiri Suchan committed Jan 23, 2019
1 parent 5a52b65 commit d475382
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/2and3/logging/__init__.pyi
Expand Up @@ -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: ...

Expand Down

0 comments on commit d475382

Please sign in to comment.