[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

Joe Jevnik report at bugs.python.org
Tue Sep 27 18:24:19 EDT 2016


Joe Jevnik added the comment:

I definitely could have used PyImport_Import and PyObject_Call to accomplish this task; however, when I looked at at the implementation of these functions it seemed like a lot of overhead and book keeping just to set a boolean. Since I was already in a C extension it would be nicer to not need to worry about PyObjects and ref counts just to set this value so I thought it would be nice to expose these small functions to users. Since this is equivalent to gc.enable or gc.disable I don't think there is a deep can of worms here. The only difference in the implementation is that it doesn't return None. There is already PyGC_Collect, so I figured these were just omitted because no one thought to add them. I don't have a burning desire to get this in, I just thought it would be a nice to have.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28254>
_______________________________________


More information about the Python-bugs-list mailing list