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 ncoghlan
Recipients Jack Liu, brett.cannon, eric.snow, josh.r, ncoghlan, serhiy.storchaka
Date 2016-09-21.15:01:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474470113.87.0.519756623869.issue28202@psf.upfronthosting.co.za>
In-reply-to
Content
To be entirely clear about what's going on, the reference cycle seen in the example arises for *any* module level function, even if it's completely empty:

>>> def f():
...     pass
... 
>>> f.__globals__["f"] is f
True

The existence of that cycle will then keep other module globals alive until the next garbage collection run.
History
Date User Action Args
2016-09-21 15:01:53ncoghlansetrecipients: + ncoghlan, brett.cannon, eric.snow, serhiy.storchaka, josh.r, Jack Liu
2016-09-21 15:01:53ncoghlansetmessageid: <1474470113.87.0.519756623869.issue28202@psf.upfronthosting.co.za>
2016-09-21 15:01:53ncoghlanlinkissue28202 messages
2016-09-21 15:01:53ncoghlancreate