Is a with on open always necessary?

K Richard Pixley rich at
Wed Jan 25 12:17:29 EST 2012

On 1/21/12 03:38 , Lie Ryan wrote:
> It is only strictly necessary for programs that opens thousands of files
> in a short while, since the operating system may limit of the number of
> active file handlers you can have.

The number you're looking for is 20 on many unix systems.  That's all. 
20 concurrently open file descriptors.

Modern systems open that number up somewhat, or make it tailorable.  But 
the number is still much lower than you might expect.


More information about the Python-list mailing list