[Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.7,1.8

Guido van Rossum gvanrossum@users.sourceforge.net
Mon, 11 Feb 2002 06:36:53 -0800


Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv1656

Modified Files:
	pep-0280.txt 
Log Message:
Answer questions by MAL; add drawing by Ping.


Index: pep-0280.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** pep-0280.txt	11 Feb 2002 07:14:05 -0000	1.7
--- pep-0280.txt	11 Feb 2002 14:36:51 -0000	1.8
***************
*** 395,398 ****
--- 395,438 ----
  
  
+ 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