Here is my class definition :
class Playingsound:
def ___init___(self):
# blah
def fadeout_and_stop(self):
# do somthing (fadeout during 100 ms)
del self
Here is my problem (similar to that one : Python object deleting itself) :
>>> a = Playingsound()
>>> time.sleep (1.0)
>>> a.fadeout_and_stop()
>>> time.sleep (1.0) # after 1 second, the playback should be finished !
>>> a
<__main__.Playingsound instance at 0x01F23170>
Instead of this, I would like a
to be totally destroyed after the call of fadeout_and_stop
, and its reference to be None
:
>>> a
<None>
How to do this with Python ?