Class TabError
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
Python's TabError: indentation that mixes tabs and spaces inconsistently (inconsistent use of tabs and
spaces in indentation).
public class TabError : IndentationError, ISerializable, INumSharpException
- Inheritance
-
TabError
- Implements
- Inherited Members
Remarks
A subclass of IndentationError and so of SyntaxError, as in Python, with the same location attributes and text rules. NumSharp never raises it; the class exists for ports.
Constructors
TabError()
Creates the error with Python's text for a bare raise TabError: "None", as for
SyntaxError().
public TabError()
Remarks
Every location attribute, msg included, is null.
TabError(string)
Creates the error with the parser's message, which is also msg.
public TabError(string message)
Parameters
messagestringThe text, verbatim.
TabError(string, Exception)
Creates the error with the parser's message and the exception that caused it (Python's raise ...
from innerException).
public TabError(string message, Exception innerException)
Parameters
messagestringThe text, verbatim.
innerExceptionExceptionThe exception that led to this one, or null for none.
TabError(string, string, int?, int?, string, int?, int?)
Python's SyntaxError(msg, (filename, lineno, offset, text[, end_lineno, end_offset])): the message and
where the error is. Message is CPython's str() of the error:
msg (file, line N), msg (file) without a line number, msg (line N) without a file name,
msg alone without either; the file is its base name.
public TabError(string msg, string filename, int? lineno, int? offset, string text, int? end_lineno = null, int? end_offset = null)
Parameters
msgstringThe parser's message without the location (
invalid syntax), or null (printedNone).filenamestringThe source's name (
<unknown>forast.literal_eval, a path), or null for none.linenoint?The 1-based line, or null for none.
offsetint?The 1-based column (CPython reports 0 for some tokenizer errors), or null for none.
textstringThe source line, or null for none.
end_linenoint?The line the error ends on, or null for none.
end_offsetint?The column it ends at, or null for none; required when
end_linenois given.
Remarks
The base name follows the operating system NumSharp runs on, as CPython's does (its my_basename splits
at the platform's SEP): on Windows C:\a\b\c.py reads c.py and a/b/c.py stays whole;
elsewhere a/b/c.py reads c.py and C:\a\b\c.py stays whole. A name that ends in the
separator reads as empty (m (, line 3)), as in CPython.
Exceptions
- TypeError
end_linenois given withoutend_offset(CPython:end_offset must be provided when end_lineno is provided).