Python Forum
exception handling by default
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
exception handling by default
#3
It sounds like what you're trying to do is have a function fdepend on the behaviour of its caller g. That at the very least sounds like a bad thing, because now f is more complex and that means harder to understand, test and change. There are probably better explanations of why to avoid this sort of thing - the kind of phrase to search for is "high level modules depend on low level modules" (and not the other way round - here f is the lower level one). You can probably find a better design, which may just be letting the caller handle the failures that the function can't handle.
Reply


Messages In This Thread
exception handling by default - by Skaperen - Sep-11-2021, 10:04 PM
RE: exception handling by default - by Yoriz - Sep-11-2021, 10:38 PM
RE: exception handling by default - by ndc85430 - Sep-12-2021, 01:19 PM
RE: exception handling by default - by Skaperen - Sep-12-2021, 03:02 PM
RE: exception handling by default - by Skaperen - Sep-12-2021, 03:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  while handling this exception, another ... Skaperen 1 1,842 Aug-22-2021, 06:16 AM
Last Post: ndc85430

Forum Jump:

User Panel Messages

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