Message31992
I tried example 11.4. from bytesofpython (by C.H. Swaroop).
Example works fine.
Added a new Person instance 'wolf' -> Program terminated with:
Exception exceptions.AttributeError: "'NoneType' object has no attribute 'population'" in <bound method Person.__del__ of <__main__.Person instance at 0xb7d48d6c>> ignored
added print list(globals()) ->
['kalam', '__builtins__', '__file__', 'DBGPHideChildren', 'swaroop', 'Person', 'wolf', '__name__', '__doc__']
changed wolf to aaa:
print list(globals()) ->
['aaa', 'kalam', '__builtins__', '__file__', 'DBGPHideChildren', 'swaroop', 'Person', '__name__', '__doc__']
Please note the position of 'aaa' at the beginning of the list, before 'Person'. With 'wolf' being after 'Person'.
If the destructing code removes items in this order, no wonder I get an error.
Person should not get deleted if refcount is still > 0.
Wolf Rogner
|
|
Date |
User |
Action |
Args |
2007-08-23 14:53:40 | admin | link | issue1717900 messages |
2007-08-23 14:53:40 | admin | create | |
|