From 0c994bd700ed6c41efca3de8059f5d54a5fef316 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 11 Feb 2002 14:36:51 +0000 Subject: [PATCH] Answer questions by MAL; add drawing by Ping. --- pep-0280.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/pep-0280.txt b/pep-0280.txt index e13d36196..0a1b2d23f 100644 --- a/pep-0280.txt +++ b/pep-0280.txt @@ -394,6 +394,46 @@ Additional Ideas self.reflect_bltin_new(key, newvalue) +FAQs + + Q. Will it still be possible to: + a) install new builtins in the __builtin__ namespace and have + them available in all already loaded modules right away ? + b) override builtins (e.g. open()) with my own copies + (e.g. to increase security) in a way that makes these new + copies override the previous ones in all modules ? + + A. Yes, this is the whole point of this design. In the original + approach, when LOAD_GLOBAL_CELL finds a NULL in the second + cell, it should go back to see if the __builtins__ dict has + been modified (the pseudo code doesn't have this yet). Tim's + alternative also takes care of this. + + Q. How does the new scheme get along with the restricted execution + model? + + A. It is intended to support that fully. + + +Graphics + + Ka-Ping Yee supplied a drawing of the state of things after + "import spam", where spam.py contains: + + import eggs + + i = -2 + max = 3 + + def foo(n): + y = abs(i) + max + return eggs.ham(y + n) + + The drawing is at http://web.lfw.org/repo/cells.gif; a larger + version is at http://lfw.org/repo/cells-big.gif; the source is at + http://lfw.org/repo/cells.ai. + + Comparison XXX Here, a comparison of the three approaches could be added.