[Tutor] checking variable types

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Thu Apr 1 20:50:57 EST 2004



On Fri, 2 Apr 2004, [iso-8859-1] Karl Pfl=E4sterer wrote:

> If your code can be written that it always assumes a list

[some text cut]


Yes, it might be easier to always assume that the parameter values from
the CGI program is a list, if you're reading from that multiple-value
selectbox.


The CGI documentation at:

    http://www.python.org/doc/lib/node404.html

talks about a high-level function called getlist() that should be useful.
It should return a list --- even a list of one element --- so that your
processing of that data should be uniform.


Hope this helps!





More information about the Tutor mailing list