class documentation
class ImmutableSandboxedEnvironment(SandboxedEnvironment): (source)
Works exactly like the regular `SandboxedEnvironment` but does not permit modifications on the builtin mutable objects `list`, `set`, and `dict` by using the :func:`modifies_known_mutable` function.
Method | is |
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 :func:`is_internal_attribute` function. |
Inherited from SandboxedEnvironment
:
Method | __init__ |
Undocumented |
Method | call |
Call an object from sandboxed code. |
Method | call |
For intercepted binary operator calls (:meth:`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 |
For intercepted unary operator calls (:meth:`intercepted_unops`) this function is executed instead of the builtin operator. This can be used to fine tune the behavior of certain operators. |
Method | format |
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 | is |
Check if an object is safely callable. By default callables are considered safe unless decorated with :func:`unsafe`. |
Method | unsafe |
Return an undefined object for unsafe attributes. |
Class Variable | default |
Undocumented |
Class Variable | default |
Undocumented |
Class Variable | intercepted |
Undocumented |
Class Variable | intercepted |
Undocumented |
Class Variable | sandboxed |
Undocumented |
Instance Variable | binop |
Undocumented |
Instance Variable | unop |
Undocumented |
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 :func:`is_internal_attribute` function.
Parameters | |
obj:t.Any | Undocumented |
attr:str | Undocumented |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |