faqts : Computers : Programming : Languages : Python : Language and Syntax

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 4 people (75%) answered Yes
Recently 2 of 3 people (67%) answered Yes

Entry

What does del do for an instance of a wrapped C class?
Does del call the destructor of a wrapped C class?

Mar 1st, 2000 21:44
Nathan Wallace, unknown unknown, Remco Gerlich


For example, let's say 'my_object' is a instance of wrapped C++ class.

  >>del my_object

All it's supposed to do is remove the name from the current namespace.
_If_ nothing else is still referring to it, then it may be removed, and
the destructor would be called then. You can't assume that 'del' will
call your destructor.