On Friday November 30, 2001 07:05 pm, Mike Orr wrote:
> On Fri, Nov 30, 2001 at 05:21:13PM -0600, Ian Bicking wrote:
> > On Fri, 2001-11-30 at 17:19, Mike Orr wrote:
> > > The problem is in Python's cgi module that Webware uses. It returns a
> > > string if there's one value, or a list if there's more than one.
> > Well, it's not really the cgi modules *fault*. It's just the way things
> > work. One value looks like ?f=a, two look like ?f=a&f=b ... you just
> > can't tell the difference. Unless, I suppose, you did the PHP thing
> > with ... but that's outside the scope of the cgi module.
> It's the module's fault for providing one method rather than two, and
> for returning an inconsistent type. Causing thousands of Python
> progammers to:
> A) have to check the type of every single field returned, even those
> which should always be single.
> B) not check, resulting in scripts that crash if a value unexpectedly
> becomes multiple.
> C) constantly reinvent the wheel, writing a function that always returns
> a list. This causes bloat in the CGI scripts, or if it's put in a
> library, makes the script non-portable unless the library is distributed
> with it.
I agree completely, the cgi module's handling of lists leaves a lot to be
desired. How should Webware improve on it? Anyone want to propose some
enhancements to the Request object for Webware 0.7 to make this nicer?