
Feb. 26, 2009
4:10 p.m.
Daniel Stutzbach wrote: ...
The "with" statement is great, but it results in the bulk of the code being indented twice. I'd like to propose a little syntactic sugar, the "try with":
try with something as f: many lines of code except some_error: handle error
Not commenting on how useful the proposal is (I'm mostly stuck in Python 2.4), but couldn't this be: with something as f: many lines of code except some_error: handle error That is, you don't really need the "try", since the above syntax is currently illegal? Eric.