Home | History | Annotate | Download | only in Python

Lines Matching defs:free

318    which determines whether a name is local, global, or free.  In addition,

320 bindings that are used for free variables in enclosed blocks.
322 There are also two kinds of free variables, implicit and explicit. An
324 global is a free variable for which the compiler has found no binding
338 are used to determine if the variable is free or an implicit global.
342 The children update the free variable set. If a local variable is free
345 frame. Cell variables are removed from the free set before the analyze
348 The sets of bound and free variables are implemented as dictionaries
372 PyObject *bound, PyObject *local, PyObject *free,
405 is a free variable rather than a global variable.
410 SET_SCOPE(dict, name, FREE);
412 if (PyDict_SetItem(free, name, Py_None) < 0)
437 /* If a name is defined in free and also in locals, then this block
438 provides the binding for the free variable. The name should be
439 marked CELL in this block and removed from the free list.
441 Note that the current block's free variables are included in free.
442 That's safe because no name can be free and local in the same scope.
446 analyze_cells(PyObject *scope, PyObject *free)
461 if (!PyDict_GetItem(free, name))
464 from free. It is safe to replace the value of name
469 if (!PyDict_DelItem(free, name) < 0)
489 "contains a nested function with free variables" :
528 PyObject *bound, PyObject *free, int classflag)
551 free_value = PyInt_FromLong(FREE << SCOPE_OFF);
555 /* add a free variable when it's only use is for creating a closure */
557 while (PyDict_Next(free, &pos, &name, &v)) {
561 /* It could be a free variable in a method of
580 /* else it's not free, probably a cell */
601 free -- set of free variables in enclosed scopes (output)
616 analyze_child_block(PySTEntryObject *entry, PyObject *bound, PyObject *free,
620 analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
668 bound, local, free, global))
688 nested blocks. The free variables in the children will
716 if (PyDict_Update(free, newfree) < 0)
732 analyze_child_block(PySTEntryObject *entry, PyObject *bound, PyObject *free,
752 if (PyDict_Update(temp_free, free) < 0)
778 PyObject *free, *global;
781 free = PyDict_New();
782 if (!free)
786 Py_DECREF(free);
789 r = analyze_block(st->st_top, NULL, free, global);
790 Py_DECREF(free);