Closed Kludex closed 1 year ago
I'm having a RET505 on elif statements, where they shouldn't be raised.
elif
from typing import Any def parser(obj: Any) -> str: if isinstance(obj, dict): return "a" elif isinstance(obj, int): return "b" return "c"
ruff main.py
main.py:5:5: RET505 Unnecessary `elif` after `return` statement
Why shouldn't it be raised? The elif is indeed superfluous here (can be just if).
if
Hmmm... Ok. :eyes:
Thanks.
Description
I'm having a RET505 on
elif
statements, where they shouldn't be raised.Code
Command
Output