with HTTPConnection as conn:

T

trylks

Hi!

Would it be possible to use a with statement with an HTTPConnection object?

I know it is not possible at this moment, it doesn't implement an
__exit__ method, at least in version 3.1.1. I was wondering if the
__exit__ method should do something more than conn.close(), something
really hard or impossible, or if there are more requisites to use the
with statement beside of implementing that method. So far it seems
easy, useful and not done yet, so I'm probably mistaken about
something, and wondering what may that be.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top