Nick Coghlan added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28202> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com