Necessity of ``pass''
Robert Roy
rjroy at takingcontrol.com
Wed Aug 25 08:48:35 EDT 1999
On 23 Aug 1999 23:32:44 +0200, forcer <forcer at mindless.com> wrote:
...
I work in an environment where we several programmers working in
Python and we maintain each other's code.
If I see the following, I can (usually safely) assume that the
programmer did not want any action taken on the if statement.
>
> if foo:
> pass
> bar
>
Faced with the following, I can make no such assumption. Hmm maybe
there is a missing indent, Maybe I wrote this on an older editor and
used different tab settings, etc..... From a maintenance point of view
this construct is utterly ambiguous.
>
> if foo:
> bar
>
The small savings incurred is not worth the maintenance headache that
would follow.
Robert Roy
rjroy-nospam at takingcontrol.com
More information about the Python-list
mailing list