pre-PEP for optional 'pass'

Martijn Faassen m.faassen at vet.uu.nl
Tue Apr 16 05:36:16 EDT 2002


phil hunt <philh at comuno.freeserve.co.uk> 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.

> There are two rationales for this: convenience and beauty.

> Thoughts?

-1

I don't think it's convenient (what's an extra line, and it occurs very
rarely in my code..), and I don't think it's pretty either.
My eyes would trip over it as much as single line if:

if foo: bar

which I think is ugly. I need the visual hint of an indented block:

if foo:
    bar

the same holds for pass:

def foo():
   pass
def bar():
   pass

is a lot easier for my eyes to parse than:

def foo():
def bar():

which leaves me with little hint of what is going on. This looks like a single
block, not two, from a distance/in the corner of my eyes. I need to read the
text instead of just look at its shape in order to understand what is going
on.

'pass' is pretty rare, and it needs to stand out when it's around. If I'm
defining an interface where there is no method body, I'll just drop in a
docstring; a good idea for an interface in any case.

Regards,

Martijn 
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list