-
-
Notifications
You must be signed in to change notification settings - Fork 414
Closed
Labels
help wantedExtra attention is neededExtra attention is neededlevel:starterGood for newcomersGood for newcomersrule requestAdding a new ruleAdding a new rule
Milestone
Description
Rule request
Thesis
There's a wonderful example about return nodes in both try and finally.
https://github.com/satwikkansal/wtfPython#-return-return-everywhere
def some_func():
try:
return 'from_try'
finally:
return 'from_finally'This will lead to an error.
Reasoning
I believe that return in finally should be restricted in case try, else, or except cases have at least a single return statement.
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededlevel:starterGood for newcomersGood for newcomersrule requestAdding a new ruleAdding a new rule