PEP 765: Disallow return/break/continue that exit a finally block

Specified, yes, but you don’t get to the specification without going past the whole bit about “use except to handle exceptions”.

Also, it’s only there because people noticed it was missing and the behaviour wasn’t documented, so it got documented. I’d take Guido’s statement of intent (and Tim’s memory) over what’s in the documentation today - plenty of stuff gets specified after it’s implemented.

Yes, it’s a bit surprising, but it does follow logically. After the first block finishes, the finally block always runs, and return None exits the current function with None as the result. You probably shouldn’t write code that way, but it’s not fundamentally wrong or dangerous, just unexpected.

Now, in the cases where fetch raised an error, we have a problem. You code silently suppresses an error, and the lack of except: block suggests that wasn’t your intent. So is it better if the error is still raised? Or better if everyone who uses your module gets a warning (that breaks their own tests/users) whether that error ever occurs or not?