pre-PEP for optional 'pass'

Russell E. Owen owen at nospam.invalid
Tue Apr 16 13:17:30 EDT 2002


In article <slrnabmoci.dhk.philh at comuno.freeserve.co.uk>,
 philh at comuno.freeserve.co.uk (phil hunt) wrote:

>OK, I've decided to write a PEP. Preliminary to this, I'd like 
>people's comments.
>
>I wish to make the pas startement optional. That is, in any Python 
>program where there is a pass it can be left out and the meaning of 
>the program is unchanged...

I'd go along with it and offer a third rationale:

The need for pass is a pain when commenting out entire blocks of code 
(e.g. while debugging). Instead of just commenting out the code, one 
must also add a "pass" statement, and then try to remember to take it 
out again when re-enabling the code.

In my opinion an optional pass is a very good thing -- sometimes you 
want to be able to assert "this block intentionally left blank", but 
sometimes it makes more sense to just accept a truly empty block.

Thanks for proposing this. I'm sure you'll get lots of horrified 
reactions (remember the fuss whenever someone suggests removing the 
required colon at the start of blocks? Forgetting that damn colon is 
still the most common mistake I make when coding Python, so I'd love to 
see it go, but it'll be a cold day in hell...)

-- Russell
-- 
Return      owen
address     astro
garbled     washington
in header   edu



More information about the Python-list mailing list