fix method name in example code

This commit is contained in:
Fred Drake 2004-01-23 04:05:27 +00:00
parent 7663729ec7
commit 226f697560

View file

@ -225,7 +225,7 @@ associated with this name. So you write a script containing for
example this code: example this code:
\begin{verbatim} \begin{verbatim}
user = form.getvalue("user").toupper() user = form.getvalue("user").upper()
\end{verbatim} \end{verbatim}
The problem with the code is that you should never expect that a The problem with the code is that you should never expect that a
@ -272,7 +272,7 @@ Using these methods you can write nice compact code:
\begin{verbatim} \begin{verbatim}
import cgi import cgi
form = cgi.FieldStorage() form = cgi.FieldStorage()
user = form.getfirst("user", "").toupper() # This way it's safe. user = form.getfirst("user", "").upper() # This way it's safe.
for item in form.getlist("item"): for item in form.getlist("item"):
do_something(item) do_something(item)
\end{verbatim} \end{verbatim}