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

pdb.set_trace

Prev: pdb.set_default_backend | Up: pdb
Rel: pdb.get_default_backend, pdb.help, pdb.Pdb, pdb.pm
Ref: docs.python.org — pdb.set_trace
Tags: #public #python3 #stdlib #pdb


Import

import pdb
from pdb import set_trace

Signature & Overview

pdb.set_trace(*, header=None, commands=None)

Enter the debugger at the calling stack frame.

Usage

import pdb

# Prefer built-in breakpoint() in Python 3.7+ (which honors PYTHONBREAKPOINT=0)
assert callable(pdb.set_trace)

Gotchas

REPL Inspect

from pdb import set_trace
help(set_trace)

Linked from

Related notes