On Fri, Sep 19, 2014 at 2:00 PM, Juan Christian
<juan0christ...@gmail.com> wrote:
> On Fri, Sep 19, 2014 at 2:50 PM, Danny Yoo <d...@hashcollision.org> wrote:
>>
>> So Python's "with" appears to require a bit more out the thing being
>> managed than the similar try-with-resources in Java.
>>
>> (http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html)
>
>
>
> Is there anything similar in Python? Putting tons of 'try-expect' in the
> code would be a bit ugly.

You might want to look at decorators.  I think that might help you
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
Joel Goldstick
http://joelgoldstick.com
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to