home *** CD-ROM | disk | FTP | other *** search
- <TITLE>Code Objects -- Python library reference</TITLE>
- Next: <A HREF="../t/type_objects" TYPE="Next">Type Objects</A>
- Prev: <A HREF="../m/methods" TYPE="Prev">Methods</A>
- Up: <A HREF="../o/other_built-in_types" TYPE="Up">Other Built-in Types</A>
- Top: <A HREF="../t/top" TYPE="Top">Top</A>
- <H3>2.1.7.5. Code Objects</H3>
- Code objects are used by the implementation to represent
- ``pseudo-compiled'' executable Python code such as a function body.
- They differ from function objects because they don't contain a
- reference to their global execution environment. Code objects are
- returned by the built-in <CODE>compile()</CODE> function and can be
- extracted from function objects through their <CODE>func_code</CODE>
- attribute.
- A code object can be executed or evaluated by passing it (instead of a
- source string) to the <CODE>exec</CODE> statement or the built-in
- <CODE>eval()</CODE> function.
- (See the Python Reference Manual for more info.)
- <P>
-