diff options
author | Fred Drake <fdrake@acm.org> | 2001-06-29 15:00:34 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-06-29 15:00:34 (GMT) |
commit | f7e504d89613517ff0356bb6591f14eaf956e312 (patch) | |
tree | c0bee01109ed18d9823e68bcf28c35fd86172a4e | |
parent | 62ebe047e4c0c07dd5cc6956c2344af4f60578ff (diff) | |
download | cpython-f7e504d89613517ff0356bb6591f14eaf956e312.zip cpython-f7e504d89613517ff0356bb6591f14eaf956e312.tar.gz cpython-f7e504d89613517ff0356bb6591f14eaf956e312.tar.bz2 |
Simplify an example based on comment from Thomas Holenstein <thomas@hex.ch>:
Do not use an extra flag variable to test only once in one subsequent if
statement.
-rw-r--r-- | Doc/lib/libcgi.tex | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Doc/lib/libcgi.tex b/Doc/lib/libcgi.tex index 285c08f..8ab562d 100644 --- a/Doc/lib/libcgi.tex +++ b/Doc/lib/libcgi.tex @@ -89,10 +89,7 @@ non-empty string: \begin{verbatim} form = cgi.FieldStorage() -form_ok = 0 -if form.has_key("name") and form.has_key("addr"): - form_ok = 1 -if not form_ok: +if not (form.has_key("name") and form.has_key("addr")): print "<H1>Error</H1>" print "Please fill in the name and addr fields." return |