Style question...

Peter Hansen peter at engcorp.com
Wed Aug 27 18:51:00 EDT 2003


Anthony Roberts wrote:
> 
> If I end indentation levels with "pass" statements, will I piss off people
> that have to read my code? eg:
> 
> for i in xrange(0,5):
>     if i:
>         print i
>         pass
>     print i * -1
>     pass
> 
> I ask for two reasons... a) it helps emacs figure it out, and b) I'm more
> comfortable ending compound statements with a token.

Sorry, but yes, I find that ugly.  If you're just starting out with 
Python, please just give it a shot without that approach for a while
and see whether you become much more comfortable *without* the token
than you ever were with it.

-Peter




More information about the Python-list mailing list