December 2000
Intermediate to advanced
816 pages
16h 57m
English
Python provides a number of built-in functions supporting callables and executable objects, including the exec statement. These functions let the programmer execute code objects as well as generate them using the compile() built-in function and are listed in Table 14.6.
| Built-in Function or Statement | Description |
|---|---|
| callable(obj) | determines if obj is callable; returns 1 if so, 0 otherwise |
| compile(string, file, type) | creates a code object from string of type type; file is where the code originates from (usually set to ″) |
| eval(obj, globals=globals(), locals=locals()) | evaluates obj, which is either a expression compiled into a code object ... |
Read now
Unlock full access