[Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.8,1.9
Guido van Rossum
gvanrossum@users.sourceforge.net
Mon, 11 Feb 2002 07:00:05 -0800
Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv11989
Modified Files:
pep-0280.txt
Log Message:
More FAQs.
Index: pep-0280.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pep-0280.txt 11 Feb 2002 14:36:51 -0000 1.8
--- pep-0280.txt 11 Feb 2002 15:00:03 -0000 1.9
***************
*** 415,418 ****
--- 415,445 ----
A. It is intended to support that fully.
+ Q. What happens when a global is deleted?
+
+ A. The module's celldict would have a cell with a NULL objptr for
+ that key.
+
+ Q. What would the C code for LOAD_GLOBAL_CELL look like?
+
+ A. case LOAD_GLOBAL_CELL:
+ cell = func_cells[oparg];
+ x = cell->objptr;
+ if (x == NULL) {
+ x = cell->cellptr->objptr;
+ if (x == NULL) {
+ ... error recovery ...
+ break;
+ }
+ }
+ Py_INCREF(x);
+ continue;
+
+ Q. What happens in the module's top-level code where there is
+ presumably no func_cells array?
+
+ A. We could do some code analysis and create a func_cells array,
+ or we could use LOAD_NAME which should use PyMapping_GetItem on
+ the globals dict.
+
Graphics