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

readline.clear_history

Prev: readline.add_history | Up: readline | Next: readline.get_begidx
Rel: readline.add_history, readline.get_begidx, readline.get_completer, readline.get_completer_delims
Ref: docs.python.org — readline.clear_history
Tags: #public #python3 #stdlib #readline


Import

import readline
from readline import clear_history

Signature & Overview

readline.clear_history()

Clear the current readline history.

Usage

import readline

readline.clear_history()
assert readline.get_current_history_length() == 0

Gotchas

REPL Inspect

from readline import clear_history
help(clear_history)

Linked from

Related notes