[Tutor] Object attributes surviving deletion

Kent Johnson kent37 at tds.net
Thu Jun 26 23:30:24 CEST 2008


On Thu, Jun 26, 2008 at 4:25 PM, Shrutarshi Basu
<technorapture at gmail.com> wrote:

> 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,

It's hard to tell without seeing some code but it sounds like some
version of this:
http://effbot.org/pyfaq/why-are-default-values-shared-between-objects.htm

Kent


More information about the Tutor mailing list