gc.garbage from paramiko
Wouter van Heyst
larstiq at larstiq.dyndns.org
Tue Feb 7 21:05:42 GMT 2006
On Tue, Feb 07, 2006 at 10:39:27AM -0800, Robey Pointer wrote:
<snip>
> I guess that was kind of vague, sorry. :) Python borrows a concept
> from c++, and causes files & sockets to auto-close themselves as soon
> as the last reference goes away. Since paramiko supplies both socket-
> like things (Channels) and file-like things (SFTPFiles), I've found
> that python coders expect them to have the same del behavior as
> builtins, allowing things like this:
>
> open('email.txt', 'w').write('jdoe at example.com')
It still is badish form in python, closing in a finally would be better.
Wouter van Heyst
More information about the bazaar
mailing list