Commit 226f6975 authored by Fred Drake's avatar Fred Drake

fix method name in example code

parent 7663729e
...@@ -225,7 +225,7 @@ associated with this name. So you write a script containing for ...@@ -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: ...@@ -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}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment