On 29/08/12 19:45, Gregory Szorc wrote:
On 8/23/2012 9:11 AM, Hanno Schlichting wrote:
Instead of using Python's ast module, you can also do a simple trick
with the exec statement and limit the global scope and only allow
certain whitelisted names. An example implementation is at
https://gist.github.com/3437909. Download it as restricted.py, put it
into a directory next to an empty Python file called evil.py and run
"python restricted.py evil.py
This is so awesome and simple I just had to try it out!
It makes the most sense to use existing language and one we are already
using. Think very carefully before inventing a new language or syntax,
then think again. You throw everything away when you create a new language.
We can begin by simply using convention to limit the use of language
features. Until we have a working build system the enforcement is just
feature creep.
Why would we not use Python?
Anthony
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform