[Numpy-discussion] Should ndarray be a context manager?

Robert Kern robert.kern at gmail.com
Tue Dec 9 15:31:37 EST 2014


On Tue, Dec 9, 2014 at 8:15 PM, Chris Barker <chris.barker at noaa.gov> wrote:
>
> (although I'm still confused as to why it's so important (in cPython) to
> have a file context manager..)
>

Because you want the file to close when the exception is raised and not at
some indeterminate point thereafter when the traceback stack frames finally
get disposed of, which can be an indefinitely long time.

-- 
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20141209/c988e4fc/attachment.html>


More information about the NumPy-Discussion mailing list