Code basics

Alex alex at somewhere.round.here
Fri Mar 17 12:44:51 EST 2000


> while notDone:
>     print ("Oh no!","Tjohoo")[this.getNumberOfSomething() == 10]
> 
> Now, I ask you folk, is that "bad" Python?  Is that "bad" programming
> in general, to be brief and succinct like that?  I'm curious -- I have
> a tendency to do things like that. :)

FWIW, I don't like it, myself.  It relies on the fact that the
comparison returns 0 or 1 for true or false, resp.  Because that's
relatively obscure, and unrelated to what the code is trying to do, it
meant the intent of the code wasn't immediately obvious.

Alex.



More information about the Python-list mailing list