\class{FieldStorage} or \class{MiniFieldStorage}
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
-(i.e., when your HTML form contains multiple fields with the same
-name), use the \function{type()} function to determine whether you
-have a single instance or a list of instances. For example, here's
-code that concatenates any number of username fields, separated by
-commas:
+If you expect this possibility (i.e., when your HTML form contains
+multiple fields with the same name), use the \function{isinstance()}
+built-in function to determine whether you have a single instance or a
+list of instances. For example, here's code that concatenates any
+number of username fields, separated by commas:
\begin{verbatim}
+from types import ListType
+
value = form.getvalue("username", "")
-if type(value) is type([]):
+if isinstance(value, ListType):
# Multiple username fields specified
usernames = ",".join(value)
else: