[Tutor] Using 'requests' + 'with statement' in Python 3.4.1

Juan Christian juan0christian at gmail.com
Fri Sep 19 20:00:55 CEST 2014


On Fri, Sep 19, 2014 at 2:50 PM, Danny Yoo <dyoo at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140919/e8f7704f/attachment.html>


More information about the Tutor mailing list