On Tue, Mar 6, 2018 at 1:25 AM, Ooomzay <ooom...@gmail.com> wrote: > Ahah... I see now you are running it from a shell so the exception is staying > in scope. We just need to include normal exception handling in the example to > fix this:- > > def main(): > try: > c = C() > c.dostuff() > except: > print("Boom!") > > main() >
So RAII depends on absorbing every exception close to where the resource is being managed? You can't permit that exception to bubble up lest the resource get leaked?? ChrisA -- https://mail.python.org/mailman/listinfo/python-list