Is RAII possible in Python?

Rainer Deyke rainerd at eldwood.com
Sat Nov 15 15:47:03 EST 2003


Pierre Rouleau wrote:
> Is RAII available in Python?

In practice, yes.  Objects are destroyed when their reference count goes to
zero.

In theory, no.  The language specification does not guarantee this behavior.


-- 
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com






More information about the Python-list mailing list