pre-PEP for optional 'pass'

Joe Mason jcmason at student.math.uwaterloo.ca
Mon Apr 15 21:20:48 EDT 2002


In article <3CBB76CA.A423AAD8 at alcyone.com>,
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.  The pass keyword removes all doubt:
>
>	if condition:
>	    pass
>	doSomething
>
>The pass keyword helps solidify this kind of behavior.  Convenience and
>beauty can't really hold a candle to utility (even if it is marginal
>utility) and precendent.

A warning might suffice.  If the problem is mainly writing code that will be
filled in later, ignoring the warning should be fine during development,
and when you're ready to release it will remind you of any you haven't
implemented yet.  (Then again, I hate seeing warnings for problems I know
about, since they distract me from new warnings, so I'd probably prefer to
fiddle with pass than to see a warning every time.  But at least there'd be
the option.)

Joe



More information about the Python-list mailing list