Dlaczego ten destruktor nie dziala

Sulsa sulsa at gazeta.pl
Sun Feb 4 11:05:03 EST 2007


Mam klase A po ktorej dziedziczy B i jesli w destruktorze klasy B
wywolam:
self.__class__.__bases__[0].__del__(self)

to wszytkos jest ok, i destruktor klasy a jest wywolywany, jesli
natomiast napisze: A.__del__(self)  to otrzymuje nastepujacy wyjatek: 
Exception exceptions.AttributeError: "'NoneType' object has no
attribute '__del__'" in <bound method B.__del__ of <__main__.B instance
at 0x2b025d04a830>> ignored

czemu tak sie dzieje?



More information about the Python-list mailing list