Python Forum
while handling this exception, another ...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
while handling this exception, another ...
#1
i have try/except within a higher except which if properly coded seems to work. how deeply can i nest try/except in the except handlers?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
What do you mean exactly? You should be able to nest them arbitrarily. Having said that, deeply nested code will likely be quite difficult to follow and the try/except obscures the happy path (because they make visible the error handling). Result types offer an alternative.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  exception handling by default Skaperen 4 1,996 Sep-12-2021, 03:09 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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