Hello,<br>I am very surprising by the Python interpreter behavior : see code<br>I initialize a 'A' and a 'B', and i give a B instance reference to the instance A in 'm1' method. I can modify (IN/OUT mode) the 'i' attribute ( aB.i = 10 ) , BUT I CANNOT DELETE "aB" into the fonction m1 ! the code " del aB " or " aB= None" has no effect. 'aB' still exists when m1() is finsihed! WHY ? How can i do that?<br>Thank you.<br>Zorgi<br><br><br>class A(object):<br> def __init__(self):<br> pass<br> def m1 (self, aB ):<br> aB.i = 10<br> del aB<br> print "no more B"<br> <br>class B(object):<br> def __init__(self,i):<br> self.i =
i<br> def __del__(self):<br> print "delete B"<br><br>aA = A ()<br>aB = B ( i = 6)<br><br>unA.m1 (aB )<br>print str( aB .i ) #---> Display 10, aB is not destroy !<br><br><br><p>
<hr size="1">
Ne gardez plus qu'une seule adresse mail ! <a href="http://fr.rd.yahoo.com/mail/mail_taglines/trueswitch/*http://www.trueswitch.com/yahoo-fr/">Copiez vos mails</a> vers Yahoo! Mail