Serhiy Storchaka added the comment: As for the patch itself, I would add an indentation for the second "if":
result = _levelToName.get(level) if result is None: result = _nameToLevel.get(level) if result is None: result = "Level %s" % level return result or even use multiple returns for the sake of microoptimization: result = _levelToName.get(level) if result is not None: return result result = _nameToLevel.get(level) if result is not None: return result return "Level %s" % level But I'm not sure that empty name is valid. It can cause problems when parse a configuration file or logs. I don't understand the use of _nameToLevel. getLevelName('CRITICAL') returns 50, that even is not a string. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29220> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com