getting rid of pass

Terry Reedy tjreedy at udel.edu
Fri May 12 21:58:05 EDT 2006


"David Murmann" <david.murmann at rwth-aachen.de> wrote in message 
news:4ckrmbF16kr2bU1 at news.dfncis.de...
> i just had this crazy idea:

Agreed ;-)

> instead of
> while cond():
>    pass
> write
> while cond().

Viewing statememts as functions of the program state, pass is the identity 
function/statement.  Many languages have the equivalent.  Being explicit is 
Python's style.  Getting rid of it would gratuitously break code for no 
reason other than your esthetic preference.

> i don't know whether this is syntactically unambiguous or replaces all
> uses of pass, but i find it quite nice to read.

while x/3.

would become somewhat ambiguous.

Terry Jan Reedy






More information about the Python-list mailing list