diff options
author | Fred Drake <fdrake@acm.org> | 2002-04-26 20:44:14 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-04-26 20:44:14 (GMT) |
commit | a7bb2b9b305bdd2f8c1e29ddcc142f72c9978b9a (patch) | |
tree | 50c14f9d130ca5ff40ccde98f65d3eb7e7b54a9c /Doc/lib | |
parent | 38f71973e52f59e51c8676299f44f829408699ff (diff) | |
download | cpython-a7bb2b9b305bdd2f8c1e29ddcc142f72c9978b9a.zip cpython-a7bb2b9b305bdd2f8c1e29ddcc142f72c9978b9a.tar.gz cpython-a7bb2b9b305bdd2f8c1e29ddcc142f72c9978b9a.tar.bz2 |
Be more consistent, both internally and with recommended practice.
This closes SF bug #547953.
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/libcgi.tex | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Doc/lib/libcgi.tex b/Doc/lib/libcgi.tex index 4ce4f5c..2f590a8 100644 --- a/Doc/lib/libcgi.tex +++ b/Doc/lib/libcgi.tex @@ -135,16 +135,14 @@ instance but a list of such instances. Similarly, in this situation, \samp{form.getvalue(\var{key})} would return a list of strings. If you expect this possibility (when your HTML form contains multiple fields with the same name), use -the \function{type()} built-in function to determine whether you +the \function{isinstance()} built-in function to determine whether you have a single instance or a list of instances. For example, this code concatenates any number of username fields, separated by commas: \begin{verbatim} -from types import ListType - value = form.getvalue("username", "") -if isinstance(value, ListType): +if isinstance(value, list): # Multiple username fields specified usernames = ",".join(value) else: |