pre-PEP for optional 'pass'

Steve Holden sholden at holdenweb.com
Wed Apr 17 09:36:52 EDT 2002


"phil hunt" <philh at comuno.freeserve.co.uk> wrote ...
> On Mon, 15 Apr 2002 17:56:42 -0700, Erik Max Francis <max at alcyone.com>
wrote:
> >phil hunt wrote:
> >
[phil wants empty nested suites]
> >
> >The purpose of pass to explicitly disclaim what you're intending to do;
> >it reduces programmer error.  In cases in code where you see something
> >like:
> >
> > if condition:
> > doSomething
> >
> >It is far more likely that this is an indentation mistake rather than a
> >deliberate null statement.
>
> I don't recall ever having made that sort of mistake. In any case,
> that sort of thing (i.e. legal but possibly wrong code) is what lint
> tools are for. The classic example being if (a = b) in C.

Well, of course, if you never make that mistake then there's no need to
ensure that the other 231,763 Python programmers don't have any problem with
it, right <wink>?

I rather suspect Max's point was that it would take more time to examine
PyChecker output to determine there really was no error than it would to put
a pass statement in to start with. This somehow loses a lot of the point of
the exercise, wouldn't you agree? [This last is a rhetorical question, since
I'm pretty sure you wouldn't agree].

However, since you are clearly bent on finishing the PEP it will stand as a
permanent record of the decision to reject it, and will therefore be a Good
Thing.

regards
 Steve







More information about the Python-list mailing list