Message253899
The are is a reference loop:
global instance -> type -> method -> module globals -> global instance
Since an instance doesn't have GC head if __slots__ is empty, the loop can't be broken.
A workaround is to add a stub element to __slots__:
__slots__ = ('__stub__',)
But operator.subscript is not the only class that causes a reference leak. Any class with empty __slots__ can create a loop and cause a leak. |
|
Date |
User |
Action |
Args |
2015-11-02 07:48:54 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, mark.dickinson, taleinat, Arfrever, steven.daprano, r.david.murray, python-dev, martin.panter, josh.r, llllllllll |
2015-11-02 07:48:54 | serhiy.storchaka | set | messageid: <1446450534.25.0.18919519243.issue24379@psf.upfronthosting.co.za> |
2015-11-02 07:48:54 | serhiy.storchaka | link | issue24379 messages |
2015-11-02 07:48:54 | serhiy.storchaka | create | |
|