[Web-SIG] Form field dictionaries
davidf at sjsoft.com
Fri Oct 24 12:28:28 EDT 2003
Gregory (Grisha) Trubetskoy wrote:
>On Fri, 24 Oct 2003, Simon Willison wrote:
>>What should GET['a'] return?
>I think this is adequately addressed in the FieldStorage starting with
>Python 2.2 with getfirst() and getlist():
That's fine, but I think it's important that these methods are available
as an addition to a standard dictionary interface.
I think the key point is, if somebody wants a list of values, they
probably know that they want a list.
It's very difficult to write code by accident that would handle a list
of values as well as a string.
So if somebody knows they want a list in certain circumstances, they
could call getlist()
But I think the default dictionary return value should be the same as
That saves endless checks for lists for those who don't need them.
More information about the Web-SIG