Re: Python Feature Request: Add the "using&quo t; keyword which works like"with& quot; in Visual Basic
On 4/14/07, BJörn Lindqvist <bjourne@gmail. comwrote:
Er.. I guess there are some details you need to work out for that. But
in principle, it works fine.
--
mvh Björn
On 4/14/07, BJörn Lindqvist <bjourne@gmail. comwrote:
On 14 Apr 2007 07:24:32 -0700, jamadagni <samjnaa@gmail. comwrote:
You can emulate only assignments like this. How would you emulate
function calls, like the ones in my example?
>
You can't, of course. But using the with statement:
>
using self.q:
.doit()
>
becomes:
>
with self.quit as q:
q.doit()
You already can emulate the using statement like this:
function calls, like the ones in my example?
You can't, of course. But using the with statement:
>
using self.q:
.doit()
>
becomes:
>
with self.quit as q:
q.doit()
in principle, it works fine.
--
mvh Björn
Comment