4 ms·
Yes, I think it should eventually if you haven't stashed a reference somewhere. Python has both a reference count and a GC so in simple cases it will often be
by kevincox 5y ago
Yes, I think it should eventually if you haven't stashed a reference somewhere.
Python has both a reference count and a GC so in simple cases it will often be cleaned up as soon as it goes out of scope but if you create a cycle it may take a while. Relying on the GC to close open sockets is a great way to run out of file descriptors when bursts of work happen.