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. -- -Mike (Iron) Orr, [EMAIL PROTECTED] (if mail problems: [EMAIL PROTECTED]) http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
