I found the following behavior at least weird:
def errors():
try:
ErrorErrorError
finally:
return 10
print errors()
# prints: 10
# It should raise: NameError: name 'ErrorErrorError' is not defined
The exception disappears when you use return
inside a finally
clause. Is that a bug? Is that documented anywhere?
But the real question (and the answer I will mark as correct) is:
What is the python developers' reason to allow that odd behavior?