A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/005475.html below:

[Python-Dev] SyntaxError/IndentationError/WhitespaceError

[Python-Dev] SyntaxError/IndentationError/WhitespaceError [Python-Dev] SyntaxError/IndentationError/WhitespaceErrorSkip Montanaro skip@mojam.com (Skip Montanaro)
Tue, 4 Jul 2000 23:57:19 -0500 (CDT)
Just back from the annual patriotic revelry...

Here are my thoughts on the various kinds of exceptions one might raise to
denote various problems with indentation.

SyntaxError - the most general form of parsing error

WhitespaceError - tells the user something's wrong with the way the
whitespace of the line parses - what -tt mode would raise

IndentationError - more specific than WhitespaceError, but indicates the
lines won't line up properly (without -tt mode) - what the parser would
raise for something like:

    try:
        1/0
	    1/0
    except ZeroDivisionError:
        pass

The distinction between WhitespaceError and IndentationError is likely to be
a bit subtle for newbies, so I wonder if it's worth the effort to
distinguish the two.

-- 
Skip Montanaro, skip@mojam.com, http://www.mojam.com/, http://www.musi-cal.com/
"To get what you want you must commit yourself for sometime" - fortune cookie




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4