[Web-SIG] Random thoughts

Barry Warsaw barry at python.org
Fri Oct 31 10:16:02 EST 2003


On Thu, 2003-10-30 at 21:51, Greg Ward wrote:

>     (But I disagree with Steve on handling multiple values for a query
>     variable that expects a single value: in that case, IMHO sloppy
>     should be the default, and you should get the first value.  I don't
>     want to guard every get_form_var() call with a "except KeyError" to
>     avoid broken/malicious clients crashing the script!)

Agreed!  I'd much rather test for None-ness or provide my own default.

>     (I've mentally toyed with funky types like Barry suggested, but I
>     think that sort of context-sensitive trickery is unPythonic.  Just
>     because you can do something doesn't mean you should.)

Greg's been reading my Oblique Strategies again. :)

-Barry





More information about the Web-SIG mailing list