summaryrefslogtreecommitdiffstats
path: root/Doc/howto
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-09-06 06:51:57 (GMT)
committerGeorg Brandl <georg@python.org>2006-09-06 06:51:57 (GMT)
commit7cae87ca7b0a3a7ce497cbd335c8ec82fe680476 (patch)
tree612cc46e728bef49b19f3d4bc26fa4951b2c1c83 /Doc/howto
parent4e472e05bdddde72d91d6f25d6e048371cf3c9be (diff)
downloadcpython-7cae87ca7b0a3a7ce497cbd335c8ec82fe680476.zip
cpython-7cae87ca7b0a3a7ce497cbd335c8ec82fe680476.tar.gz
cpython-7cae87ca7b0a3a7ce497cbd335c8ec82fe680476.tar.bz2
Patch #1550800: make exec a function.
Diffstat (limited to 'Doc/howto')
-rw-r--r--Doc/howto/doanddont.tex6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/howto/doanddont.tex b/Doc/howto/doanddont.tex
index df3ca34..d81c374 100644
--- a/Doc/howto/doanddont.tex
+++ b/Doc/howto/doanddont.tex
@@ -81,7 +81,7 @@ There are situations in which \code{from module import *} is just fine:
\end{itemize}
-\subsection{Unadorned \keyword{exec}, \function{execfile} and friends}
+\subsection{Unadorned \function{exec}, \function{execfile} and friends}
The word ``unadorned'' refers to the use without an explicit dictionary,
in which case those constructs evaluate code in the {\em current} environment.
@@ -93,10 +93,10 @@ Bad examples:
\begin{verbatim}
>>> for name in sys.argv[1:]:
->>> exec "%s=1" % name
+>>> exec("%s=1" % name)
>>> def func(s, **kw):
>>> for var, val in kw.items():
->>> exec "s.%s=val" % var # invalid!
+>>> exec("s.%s=val" % var) # invalid!
>>> execfile("handler.py")
>>> handle()
\end{verbatim}