Important
This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.
If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).
Module:core.guarded_eval
3 Classes
Bases: NamedTuple
Auto import method
Evaluation policy identifier
Global namespace
Whether the evaluation of code takes place inside of a subscript. Useful for evaluating :-1, 'col'
in df[:-1, 'col']
.
Local namespace
Overrides for evaluation policy
Bases: Exception
Exception raised when guard rejects evaluation attempt.
Bases: object
A dummy class used to create objects of other classes without calling their __init__
Evaluate provided code in the evaluation context.
If evaluation policy given by context is set to forbidden
no evaluation will be performed; if it is set to dangerous
standard eval()
will be used; finally, for any other, policy eval_node()
will be called on parsed AST.
Evaluate AST node in provided context.
Applies evaluation restrictions defined in the context. Currently does not support evaluation of functions with keyword arguments.
Does not evaluate actions that always have side effects:
class definitions (class sth: ...
)
function definitions (def sth: ...
)
variable assignments (x = 1
)
augmented assignments (x += 1
)
deletions (del x
)
Does not evaluate operations which do not return values:
assertions (assert x
)
pass (pass
)
imports (import x
)
control flow:
conditionals (
if x:
) except for ternary IfExp (a if x else b
)loops (
for
andwhile
)exception handling
The purpose of this function is to guard against unwanted side-effects; it does not give guarantees on protection from malicious code execution.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4