pre-PEP for optional 'pass'
phil hunt
philh at comuno.freeserve.co.uk
Tue Apr 16 18:24:50 EDT 2002
On Mon, 15 Apr 2002 17:56:42 -0700, Erik Max Francis <max at alcyone.com> wrote:
>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.
>
>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.
--
<"><"><"> Philip Hunt <philh at comuno.freeserve.co.uk> <"><"><">
"I would guess that he really believes whatever is politically
advantageous for him to believe."
-- Alison Brooks, referring to Michael
Portillo, on soc.history.what-if
More information about the Python-list
mailing list