Why won\'t this work? I\'m trying to make an instance of a class delete itself.
>>> class A():
def kill(self):
del self
>>>
Realistically you should not need to delete the object to do what you are trying to do. Instead you can change the state of the object. An example of how this works without getting into the coding would be your player fighting a monster and killing the monster. The state of this monster is fighting. The monster will be accessing all methods needed for fighting. When the monster dies because his health drops to 0, the monsters state will change to dead and your character will stop attacking automatically. This methodology is very similar to using flags or even keywords.
Also apparently in python deleting classes is not required since they will be garbage collected automatically when they are not used anymore.