Lifetime of a local reference
info at tundraware.com
Tue Feb 26 17:08:05 EST 2019
On 2/26/19 3:54 PM, Marko Rauhamaa wrote:
> Consider this function:
> def fun():
> f = open("lock")
> flock.flock(f, fcntl.LOCK_EX)
> Question: can a compliant Python implementation close f (and,
> consequently, release the file lock) before/while do_stuff() is
> I couldn't find an immediate answer in the documentation.
Not quite sure what you are asking. Are you asking if the file handle
can be closed before (or concurrently if do_stuff() is a thread) and
do_stuff() can continue to make use of the handle?
More information about the Python-list