IPython Documentation

Table Of Contents

Previous topic

Module: core.autocall

Next topic

Module: core.compilerop

This Page

Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

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.