Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
try_finally question
#2
Finally always runs, no matter what happens in the try body. The function cannot exit after the try return because it must execute the finally body. Since the finally also returns, it replaces the return value fyom the try return.
akbarza likes this post
Reply


Messages In This Thread
try_finally question - by akbarza - Oct-07-2023, 11:22 AM
RE: try_finally question - by deanhystad - Oct-07-2023, 11:48 AM
RE: try_finally question - by akbarza - Oct-08-2023, 10:01 AM
RE: try_finally question - by snippsat - Oct-08-2023, 12:15 PM

Forum Jump:

User Panel Messages

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