[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

Steven D'Aprano report at bugs.python.org
Thu Aug 13 20:55:12 EDT 2020


Steven D'Aprano <steve+python at pearwood.info> added the comment:

> I wrap a function's logic with `gc.disable()` to prevent GC from triggering some race condition.

If this race condition is a bug in gc, then we should fix that.

If it is a bug in your code, surely you should fix that rather than disable gc.

Either way, I don't think we should complicate the gc iterface by adding a second way to enable and disable the cyclic gc.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41545>
_______________________________________


More information about the Python-bugs-list mailing list