class documentation

class ImmutableSandboxedEnvironment(SandboxedEnvironment):

View In Hierarchy

Works exactly like the regular SandboxedEnvironment but does not permit modifications on the builtin mutable objects list, set, and dict by using the modifies_known_mutable function.
Method is​_safe​_attribute No summary

Inherited from SandboxedEnvironment:

Method call​_binop For intercepted binary operator calls (intercepted_binops) this function is executed instead of the builtin operator. This can be used to fine tune the behavior of certain operators.
Method call​_unop For intercepted unary operator calls (intercepted_unops) this function is executed instead of the builtin operator. This can be used to fine tune the behavior of certain operators.
Method is​_safe​_callable Check if an object is safely callable. By default callables are considered safe unless decorated with unsafe.
Class Variable default​_binop​_table Undocumented
Class Variable default​_unop​_table Undocumented
Class Variable intercepted​_binops Undocumented
Class Variable intercepted​_unops Undocumented
Method __init__ Undocumented
Method call Call an object from sandboxed code.
Method format​_string If a format call is detected, then this is routed through this method so that our safety sandbox can be used for it.
Method getattr Subscribe an object from sandboxed code and prefer the attribute. The attribute passed must be a bytestring.
Method getitem Subscribe an object from sandboxed code.
Method unsafe​_undefined Return an undefined object for unsafe attributes.
Class Variable sandboxed Undocumented
Instance Variable binop​_table Undocumented
Instance Variable unop​_table Undocumented
def is_safe_attribute(self, obj, attr, value):
The sandboxed environment will call this method to check if the attribute of an object is safe to access. Per default all attributes starting with an underscore are considered private as well as the special attributes of internal python objects as returned by the is_internal_attribute function.
Parameters
obj:t.AnyUndocumented
attr:strUndocumented
value:t.AnyUndocumented
Returns
boolUndocumented