From ea6e19c3d43971de22a5cfb8c8a5bcf9dc5183c7 Mon Sep 17 00:00:00 2001
From: Guido van Rossum <guido@python.org>
Date: Tue, 7 Mar 1995 10:11:15 +0000
Subject: added code objects

---
 Doc/lib/libtypes.tex | 22 ++++++++++++++++++++++
 Doc/libtypes.tex     | 22 ++++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/Doc/lib/libtypes.tex b/Doc/lib/libtypes.tex
index 1d5beb4..d93c402 100644
--- a/Doc/lib/libtypes.tex
+++ b/Doc/lib/libtypes.tex
@@ -505,6 +505,7 @@ global name space (this is the same as \code{\var{m}.__dict__} where
 \var{m} is the module in which the function \var{f} was defined).
 
 \subsubsection{Methods.}
+\obindex{method}
 
 Methods are functions that are called using the attribute notation.
 There are two flavors: built-in methods (such as \code{append()} on
@@ -521,6 +522,27 @@ Calling \code{\var{m}(\var{arg-1}, \var{arg-2}, {\rm \ldots},
 
 (See the Python Reference Manual for more info.)
 
+\subsubsection{Code Objects.}
+\obindex{code}
+
+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()} function and can be
+extracted from function objects through their \code{func_code}
+attribute.
+\bifuncindex{compile}
+\ttindex{func_code}
+
+A code object can be executed or evaluated by passing it (instead of a
+source string) to the \code{exec} statement or the built-in
+\code{eval()} function.
+\stindex{exec}
+\bifuncindex{eval}
+
+(See the Python Reference Manual for more info.)
+
 \subsubsection{Type Objects.}
 
 Type objects represent the various object types.  An object's type is
diff --git a/Doc/libtypes.tex b/Doc/libtypes.tex
index 1d5beb4..d93c402 100644
--- a/Doc/libtypes.tex
+++ b/Doc/libtypes.tex
@@ -505,6 +505,7 @@ global name space (this is the same as \code{\var{m}.__dict__} where
 \var{m} is the module in which the function \var{f} was defined).
 
 \subsubsection{Methods.}
+\obindex{method}
 
 Methods are functions that are called using the attribute notation.
 There are two flavors: built-in methods (such as \code{append()} on
@@ -521,6 +522,27 @@ Calling \code{\var{m}(\var{arg-1}, \var{arg-2}, {\rm \ldots},
 
 (See the Python Reference Manual for more info.)
 
+\subsubsection{Code Objects.}
+\obindex{code}
+
+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()} function and can be
+extracted from function objects through their \code{func_code}
+attribute.
+\bifuncindex{compile}
+\ttindex{func_code}
+
+A code object can be executed or evaluated by passing it (instead of a
+source string) to the \code{exec} statement or the built-in
+\code{eval()} function.
+\stindex{exec}
+\bifuncindex{eval}
+
+(See the Python Reference Manual for more info.)
+
 \subsubsection{Type Objects.}
 
 Type objects represent the various object types.  An object's type is
-- 
cgit v0.12

