IPython Documentation

Table Of Contents

Previous topic

Module: core.autocall

Next topic

Module: core.compilerop

This Page

Module: core.builtin_trap

A context manager for managing things injected into __builtin__.

Authors:

  • Brian Granger
  • Fernando Perez

1 Class

class IPython.core.builtin_trap.BuiltinTrap(shell=None)

Bases: IPython.config.configurable.Configurable

__init__(shell=None)
activate()

Store ipython references in the __builtin__ namespace.

add_builtin(key, value)

Add a builtin and save the original.

deactivate()

Remove any builtins which might have been added by add_builtins, or restore overwritten ones to their previous values.

remove_builtin(key, orig)

Remove an added builtin and re-set the original.