Searching equivalent to C++ RAII or deterministic destructors
davea at dejaviewphoto.com
Thu Jul 2 15:21:40 CEST 2009
Christian Heimes wrote:
> Dave Angel wrote:
>> Look also at 'del' a command in the language which explicitly deletes an
> No, you are either explaining it the wrong way or you have been fallen
> for a common misinterpretation of the del statement. The del statement
> only removes the object from the current scope. This means it decreases
> the reference count by one. It does *not* remove the object.
You're right of course. What I was trying to say was it deletes the
reference to the object. Unlike obj = None, del obj removes the
reference (attribute) entirely. Although I don't know what it should be
called if it's a local variable. Perhaps it "unbinds" the name.
More information about the Python-list