Py3K idea: why not drop the colon?

skip at pobox.com skip at pobox.com
Tue Nov 14 12:16:13 EST 2006


    >>> Michael Hobbs wrote:
    >>>> True enough. Although, I have to ask how many times you define a new
    >>>> function only to have Python spit a syntax error out at you saying that
    >>>> you forgot a colon. It happens to me all the time.
    >> 
    >> I confess I find myself in the position of a Yorkshire Youngster - I
    >> don't believe you!

    Robert> Okay, not often enough or annoyingly enough for me to remember
    Robert> having done so.  Perhaps seven years ago when I started using
    Robert> Python, but not any time recent.

If your editor knows about Python's block structure (as Emacs's python-mode
does), when you forget the colon it's immediately obvious because the next
line doesn't autoindent properly.

Skip



More information about the Python-list mailing list