[Web-SIG] Form field dictionaries

Gregory Collins greg-keyword-python.0eae23 at subrosa.ca
Fri Oct 24 12:23:49 EDT 2003


"Gregory (Grisha) Trubetskoy" <grisha at modpython.org> writes:

> On Fri, 24 Oct 2003, Simon Willison wrote:
> 
> > script.py?a=1&a=2
> >
> > What should GET['a'] return?
> 
> I think this is adequately addressed in the FieldStorage starting with
> Python 2.2 with getfirst() and getlist():

I agree, I think this is the appropriate solution; I'd rather see all
the typechecking pushed down into the library function rather than
being exposed to the programmer. If the argument I'm looking for
doesn't make sense as a list then I wouldn't care if it was given
twice; if I'm expecting something to be a list then I'd want it to be
a list even if it were empty or singleton.

Gregory D. Collins
<greg at subrosa.ca>



More information about the Web-SIG mailing list