Qudi
Public Member Functions | Public Attributes | List of all members
builtin_trap.BuiltinTrap Class Reference

Protect builtins from code in some environment. More...

Public Member Functions

def __init__ (self)
 
def __enter__ (self)
 Enter a code segment that should not chane builtins.
 
def __exit__ (self, type, value, traceback)
 Leave a code segment that should not change builtins. More...
 
def add_builtin (self, key, value)
 Add a builtin and save the original. More...
 
def remove_builtin (self, key, orig)
 Remove an added builtin and re-set the original. More...
 
def activate (self)
 Store ipython references in the builtin namespace. More...
 
def deactivate (self)
 Remove any builtins which might have been added by add_builtins, or restore overwritten ones to their previous values. More...
 

Public Attributes

 auto_builtins
 

Detailed Description

Protect builtins from code in some environment.

Member Function Documentation

◆ __exit__()

def builtin_trap.BuiltinTrap.__exit__ (   self,
  type,
  value,
  traceback 
)

Leave a code segment that should not change builtins.

Parameters
typevalue:
traceback

◆ activate()

def builtin_trap.BuiltinTrap.activate (   self)

Store ipython references in the builtin namespace.

◆ add_builtin()

def builtin_trap.BuiltinTrap.add_builtin (   self,
  key,
  value 
)

Add a builtin and save the original.

◆ deactivate()

def builtin_trap.BuiltinTrap.deactivate (   self)

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

◆ remove_builtin()

def builtin_trap.BuiltinTrap.remove_builtin (   self,
  key,
  orig 
)

Remove an added builtin and re-set the original.


The documentation for this class was generated from the following file: