-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
97 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
.. _policy_builtins: | ||
|
||
Policies & builtins | ||
------------------- | ||
|
||
.. todo:: | ||
|
||
Should be described in detail. | ||
Especially the difference between builtins and a policy which is a NodeTransformer. | ||
|
||
|
||
RestrictedPython provides a way to define Policies, by redefining restricted versions of ``print``, ``getattr``, ``setattr``, ``import``, etc.. | ||
As shortcuts it offers three stripped down versions of Pythons ``__builtins__``: | ||
|
||
.. _predefined_builtins: | ||
|
||
Predefined builtins | ||
................... | ||
|
||
.. todo:: | ||
|
||
Describe more in details | ||
|
||
* ``safe_builtins`` a safe set of builtin modules and functions, | ||
* ``limited_builtins`` which provides restricted sequence types, | ||
* ``utilities_builtins`` which provides access for standard modules math, random, string and for sets. | ||
|
||
Guards | ||
...... | ||
|
||
Also RestrictedPython provides a way to define Policies, by redefining restricted versions of ``print``, ``getattr``, ``setattr``, ``import``, etc.. | ||
As shortcutes it offers three stripped down versions of Pythons ``__builtins__``: | ||
.. todo:: | ||
|
||
* ``safe_builtins`` (by Guards.py) | ||
* ``limited_builtins`` (by Limits.py), which provides restriced sequence types | ||
* ``utilities_builtins`` (by Utilities.py), which provides access for standard modules math, random, string and for sets. | ||
Describe Guards and predefined guard methods in details | ||
|
||
There is also a guard function for making attributes immutable --> ``full_write_guard`` (write and delete protected) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@loechel Please remove this line with the comment sign.