[issue33267] ctypes array types create reference cycles

2018-04-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Pretty sure this is a problem with classes in general; classes are self-referencing, and using multiplication to create new ctypes array types is creating new classes. -- nosy: +josh.r

[issue33267] ctypes array types create reference cycles

2018-04-12 Thread Ned Deily
Change by Ned Deily : -- nosy: +amaury.forgeotdarc, belopolsky, meador.inge ___ Python tracker ___

[issue33267] ctypes array types create reference cycles

2018-04-12 Thread Eric Wieser
Eric Wieser added the comment: Apologies, I missed the important part of that snippet: ``` In [3]: gc.collect(); x = make_array_ctype((1,)); del x; gc.collect() Out[3]: 7 ``` -- ___ Python tracker

[issue33267] ctypes array types create reference cycles

2018-04-12 Thread Eric Wieser
New submission from Eric Wieser : Discovered in https://github.com/numpy/numpy/pull/10882/files#r180813166 A reproduction: ``` In [1]: import ctypes In [2]: def make_array_ctype(shape): ...: import ctypes ...: ct = ctypes.c_uint8 ...: for i in