Message31994
I took the example mentioned from here:
http://www.python.org/doc/essays/cleanup/
and added this line to the end:
wolf = Person('wolf')
and it gives the reported error. Here is a minimal snippet that produces the same error when executed as the top-level module:
class Person:
population = 0
def __del__(self):
Person.population -= 1
wolf = Person()
This appears to be consistent with the behavior described here:
http://www.python.org/doc/essays/cleanup/
While I understand that cleaning up a module at exit time is probably not an easy thing to make arbitrarily smart, this behavior seems a little too not-smart to me. It seems like it's not all that hard to get bitten by it, and the error makes no sense unless you're familiar with the module cleanup algorithm.
For what it's worth, I offer to help make module cleanup a little smarter, although I may not be able to spend much time on it until I finish some things I'm already committed to do. |
|
Date |
User |
Action |
Args |
2007-08-23 14:53:40 | admin | link | issue1717900 messages |
2007-08-23 14:53:40 | admin | create | |
|