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

The existence of that cycle will then keep other module globals alive until the 
next garbage collection run.


Python tracker <>
Python-bugs-list mailing list

Reply via email to