win32 file locking

Andrew Bennetts andrew at canonical.com
Fri May 27 13:07:50 BST 2005


On Fri, May 27, 2005 at 01:22:20AM +1000, Martin Pool wrote:
[...]
> 
> The limitations of __del__ imply that RIAA will just never work well
> in Python.

You mean RAII, I think ;)

Yes, it's not an idiom that works well with Python, although there's been
discussion on python-dev recently proposing:

    with r = some_resource(args):
        do_stuff(r)

(and many many variations on this syntax).  There are several competing
PEPs for this, such as PEP 310 and PEP 340.  If you have too much time on
your hands, read the hundreds of posts in the python-dev archives ;)

-Andrew.





More information about the bazaar mailing list