S
skip
I am working on a file locking class which I'd like to work with Python
2.5's context managers. The acquire method takes an optional timeout
argument:
class FileLock:
...
def acquire(self, timeout=None):
...
def __enter__(self):
self.acquire()
return self
Can that optional timeout be somehow accommodated by the with statement?
(I'm thinking no, which may not be a big shortcoming anyway.)
Thx,
Skip
2.5's context managers. The acquire method takes an optional timeout
argument:
class FileLock:
...
def acquire(self, timeout=None):
...
def __enter__(self):
self.acquire()
return self
Can that optional timeout be somehow accommodated by the with statement?
(I'm thinking no, which may not be a big shortcoming anyway.)
Thx,
Skip