Python Forum
Am I a retard - else and finally blocks in a try statement
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Am I a retard - else and finally blocks in a try statement
#7
You label the code "innocuous", but it's hard to guarantee that. In the first case if the innocuous code does raise an exception, it might (incorrectly) be caught by the exception handlers. Putting it in else guarantees that any exceptions it does raise are not caught locally.
Reply


Messages In This Thread
RE: Am I a retard - else and finally blocks in a try statement - by bowlofred - Jan-12-2021, 05:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  RSA Cipher with blocks Paragoon2 0 626 Nov-26-2023, 04:35 PM
Last Post: Paragoon2
  How to properly format rows and columns in excel data from parsed .txt blocks jh67 7 2,178 Dec-12-2022, 08:22 PM
Last Post: jh67
  Help with try, except, else finally Pytho13 14 5,454 Mar-23-2021, 05:35 PM
Last Post: snippsat
  How to tabulate correctly repeated blocks? Xiesxes 4 3,133 Mar-21-2020, 04:57 PM
Last Post: Xiesxes
  try/except blocks newbieAuggie2019 11 5,148 Oct-05-2019, 05:55 PM
Last Post: newbieAuggie2019
  Understanding program blocks newbieAuggie2019 2 2,129 Oct-02-2019, 06:22 PM
Last Post: newbieAuggie2019
  finally clause Skaperen 6 4,083 Jun-02-2019, 09:02 PM
Last Post: snippsat
  try, except, finally ? microphone_head 3 2,994 Apr-28-2019, 09:36 PM
Last Post: microphone_head
  The Empty List Blocks Recursion leoahum 6 5,588 Mar-05-2019, 06:55 PM
Last Post: leoahum

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020