[Tutor] Deleting an instance of an object
kabads at gmail.com
Thu Sep 23 11:19:22 CEST 2004
I've designed an OOP program, where I keep a catalogue of
publications. I want to be able to delete an instance of Article
(Article is a subclass of Issue, which is a subclass of Title, which
is a subclass of MagazineCollection). Each instance of Article has an
attribute name (article.name).
I've created a loop which searches through the article.name(s) and
found the one I want. The user has specified which one they want to
delete and I've collected that.
The problem I'm having is finding out the instantiation of self.name -
is there a hard and fast way of identifying a particular instance of
I'm getting the error:
AttributeError: 'str' object has no attribute '__del__'
which is strange, as the Deleted is coming from a __del__ function
that I placed in the Article class.
More information about the Tutor