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

readline.set_history_length

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


Import

import readline
from readline import set_history_length

Signature & Overview

readline.set_history_length(length, /)

Set the maximal number of lines which will be written to the history file.

Usage

import readline

readline.set_history_length(500)
assert readline.get_history_length() == 500

Gotchas

REPL Inspect

from readline import set_history_length
help(set_history_length)

Linked from

Related notes