[ftputil] Implementing PEP 343: The 'with' statement

Roger Demetrescu roger.demetrescu at gmail.com
Wed Jul 23 14:29:33 CEST 2008


Hi,

I have a suggestion: FTPHost could implement __enter__ and __exit__
methods necessary to allow the use of `with` statement like that:


with ftputil.FTPHost('host', 'username', 'password') as host:
    host.chdir('/some/path')
    # do some more operations


Cheers,

Roger


More information about the ftputil mailing list