Well, native syntax would be much useful, but ContextStack seems like a decent workaround. Will it be included in the stdlib (py3.3)?
On 2012-02-04, at 1:22 AM, Nick Coghlan wrote:
On Sat, Feb 4, 2012 at 1:09 AM, Yury Selivanov firstname.lastname@example.org wrote:
As of now, without "nested" we have either option of reimplementing it, or to write lots of ugly code with nested 'try..except's. So the feature was taken out, but nothing replaced it.
What do you think guys?
I think you should try contextlib2 :)
Specifically, ContextStack: http://contextlib2.readthedocs.org/en/latest/index.html#contextlib2.ContextS...
-- Nick Coghlan | email@example.com | Brisbane, Australia