[Tutor] Object attributes surviving deletion

Shrutarshi Basu technorapture at gmail.com
Thu Jun 26 22:25:59 CEST 2008


I've been writing code where we have a class that does some basic
ordering and packaging of data we send in its constructor. Let's call
it Gen. At a particular point in our code we create an object:

genObject = Gen( someInt, someInt, aDict, aList)

genObject has a dictionary called dbase, which use later on. Once we
are we destroy the object with

del genObject

At least that's what we want to do. This whole thing is inside a
function. However, when we call that function again to create another
Gen object, the new object seems to retain the dbase dictionary from
the last time, even though we used del and then made a new object. Is
there something about Python's object model that we're missing?
Thanks for your help,
Basu

-- 
The ByteBaker :
http://www.bytebaker.com


More information about the Tutor mailing list