Multiple conditional expression
John Machin
sjmachin at lexicon.net
Tue Mar 3 19:07:46 EST 2009
On Mar 4, 10:53 am, Mel <mwil... at the-wire.com> wrote:
> bearophileH... at lycos.com wrote:
> > Chris Rebert:
> >> That seems to just be an overly complicated way of writing:
> >> spaces = bool(form.has_key('spaces') and form.getvalue('spaces') == 1)
> > Better:
> > spaces = bool(('spaces' in form) and form.getvalue('spaces') == 1)
>
> Is it still necessary to convert the result (and of two comparison
> operations) to bool?
>
Still? It never was necessary.
More information about the Python-list
mailing list