How to write verbose scripts

John Machin sjmachin at lexicon.net
Tue Sep 2 17:14:47 EDT 2008


On Sep 3, 3:52 am, Mensanator <mensana... at aol.com> wrote:
> On Sep 2, 11:55 am, Steven D'Aprano <st... at REMOVE-THIS-
>
>   if (p & 1)==1:
>     print_evens = True
>   else:
>     print_evens = False
>   if (p & 2)==2:
>     print_odds = True
>   else:
>     print_odds = False
>   if (p & 4)==4:
>     print_debug = True
>   else:
>     print_debug = False

No, no, no, you've taken "How to write verbose scripts" rather too
literally; try this:

print_evens = p & 1
print_odds = p & 2
print_debug = p & 4



More information about the Python-list mailing list