Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104538

context managers inline?

From Neal Becker <ndbecker2@gmail.com>
Newsgroups comp.lang.python
Subject context managers inline?
Date 2016-03-10 13:33 -0500
Message-ID <mailman.144.1457634813.15725.python-list@python.org> (permalink)

Show all headers | View raw


Is there a way to ensure resource cleanup with a construct such as:

x = load (open ('my file', 'rb))

Is there a way to ensure this file gets closed?

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

context managers inline? Neal Becker <ndbecker2@gmail.com> - 2016-03-10 13:33 -0500
  Re: context managers inline? sohcahtoa82@gmail.com - 2016-03-10 10:47 -0800
    Re: context managers inline? Neal Becker <ndbecker2@gmail.com> - 2016-03-10 13:59 -0500
    Re: context managers inline? Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-10 12:19 -0700
    Re: context managers inline? jmp <jeanmichel@sequans.com> - 2016-03-11 11:42 +0100
  Re: context managers inline? Steven D'Aprano <steve@pearwood.info> - 2016-03-11 15:35 +1100

csiph-web