mne-tools/mne-python — pull request #387 by dengemann (2013-01-15 14:09:13+00:00)
Title: WIP: With statement

This is realted to #368.
Tests pass, besides the mysterious EEG layout...
Tried to keep things simple. Just return self on __enter__ and close the fids on __exit__ while passing error type, message and trace back in the case of an exception.
One of the tests I planned to include does not work. The idea was to check whether the local block variable assigned by the 'as' keyword is in locals() after the block. If you run it outside of a functions it's not, inside a function it is ... But nevermind, not that important.
From my side I'm not sure what could be added.
Wdyt?