Benjamin Rutt wrote: > If I did the following in an infinite loop, would the host system/user > account soon run out of file descriptors? (I'm thinking no, since I'd > imagine that a file object has a __del__-like method that will call > close() automatically since it goes out of scope): > > open('/home/rutt/.bashrc,'r').read()
under CPython, this is not a problem (the reference counting system will make sure that file handles are reclaimed as fast as new ones are opened). under an arbitrary Python implementation, it may be a problem, especially if the implementation doesn't trigger a collection if it runs out of handles (that can be seen as a bug, though...). </F> -- http://mail.python.org/mailman/listinfo/python-list