[Python-ideas] More things in the standard library equipped with __enter__ and __exit__

Calvin Spealman 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:
> Hello,
>
> 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,
>
> Regards
> Tarek
>
> --
> 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
> http://mail.python.org/mailman/listinfo/python-ideas
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy



More information about the Python-ideas mailing list