Help! File objects and scoping

bens bs343 at
Wed Jun 8 10:01:57 CEST 2005

Dave Benjamin wrote:
> Here's the problem: the "mmap" object doesn't have a reference to
> "somefile", only to its file descriptor number. So, when getfile() goes
> out of scope, there are no references left, and the file gets closed
> automatically.

That makes a lot of sense.  It's now how I would have built mmap, but I
can live with it.

Many thanks,

More information about the Python-list mailing list