Message277153
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. |
|
Date |
User |
Action |
Args |
2016-09-21 15:01:53 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, eric.snow, serhiy.storchaka, josh.r, Jack Liu |
2016-09-21 15:01:53 | ncoghlan | set | messageid: <1474470113.87.0.519756623869.issue28202@psf.upfronthosting.co.za> |
2016-09-21 15:01:53 | ncoghlan | link | issue28202 messages |
2016-09-21 15:01:53 | ncoghlan | create | |
|