On this page
  1. gc.set_debug
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

gc.set_debug

Prev: gc.isenabled | Up: gc | Next: gc.set_threshold
Rel: gc.collect, gc.disable, gc.enable, gc.freeze
Ref: docs.python.org — gc.set_debug
Tags: #public #python3 #stdlib #gc


Import

import gc
from gc import set_debug

Signature & Overview

gc.set_debug(flags, /)

Set the garbage collection debugging flags.

Usage

import gc

old = gc.get_debug()
gc.set_debug(0)
try:
    assert gc.get_debug() == 0
finally:
    gc.set_debug(old)

Gotchas

REPL Inspect

from gc import set_debug
help(set_debug)

Linked from

Related notes