This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alanmcintyre
Recipients
Date 2007-05-14.15:38:19
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.
History
Date User Action Args
2007-08-23 14:53:40adminlinkissue1717900 messages
2007-08-23 14:53:40admincreate