e read.
Adam
Adam Brand
SilverKey Technologies
From: [email protected]
[mailto:[email protected]] On Behalf Of Curt Hagenlocher
Sent: Sunday, March 29, 2009 6:27 PM
To: Discussion of IronPython
Subject: Re: [IronPython] try...finally in yield
Maybe I
lReader.Create(xml) as xr:
> for n in _process(xr): yield n
>
>
>
>
>
> Adam Brand
>
> SilverKey Technologies
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Curt Hagenlocher
> *Sent:* Saturday
r.Create(xml) as xr:
for n in _process(xr): yield n
Adam Brand
SilverKey Technologies
From: [email protected]
[mailto:[email protected]] On Behalf Of Curt Hagenlocher
Sent: Saturday, March 28, 2009 7:39 PM
To: Discussion of IronPython
Subject: Re:
So I assume you're calling close() on the generator? A try/finally around
the code in the generator can be used to catch the StopIteration exception
and force the dispose. But even better, you could say "from __future__
import with_statement" at the top of your file and then say something like
th