missing 'xor' Boolean operator

Asun Friere afriere at yahoo.co.uk
Wed Jul 15 10:55:33 CEST 2009


On Jul 15, 5:44 pm, Mark Dickinson <dicki... at gmail.com> wrote:
> On Jul 15, 5:07 am, "Dr. Phillip M. Feldman" <pfeld... at verizon.net>
> wrote:

[snip]

> >    for arg in args:
> >       if bool(arg): result= not result
>
> It's more idiomatic to say "if arg: ..." rather than "if bool
> (arg): ...".
>

Ah yes, but not once conditional tests, (just like logical operators),
type-check to ensure they have been supplied with Boolean entities. ;)



More information about the Python-list mailing list