[Python-ideas] More things in the standard library equipped with __enter__ and __exit__
ironfroggy at gmail.com
Sun Jan 18 14:31:07 CET 2009
+1 on both
On Sun, Jan 18, 2009 at 7:40 AM, Tarek Ziadé <ziade.tarek at gmail.com> wrote:
> I have entered this yesterday : http://bugs.python.org/issue4972.
> about the fact that ftplib.FTP could be
> used in a "with" loop.
> But I spotted that imaplib.IMAP4/IMAP4_SSL and smtplib.SMTP could be
> equipped as well,
> so an __exit__ call takes care of closing or quiting.
> This change could be done together with some examples in the documentation.
> If this sounds like a good idea, I can start a patch in #4972,
> Tarek Ziadé | Association AfPy | www.afpy.org
> Blog FR | http://programmation-python.org
> Blog EN | http://tarekziade.wordpress.com/
> Python-ideas mailing list
> Python-ideas at python.org
Read my blog! I depend on your acceptance of my opinion! I am interesting!
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy
More information about the Python-ideas