More FAQs.
This commit is contained in:
parent
0c994bd700
commit
9c4c598a79
27
pep-0280.txt
27
pep-0280.txt
|
@ -414,6 +414,33 @@ FAQs
|
|||
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue