PythonIndenter counts a tab as 8 columns and never checks that the lines of a block use consistent indentation characters, so a file mixing tabs and spaces compiles with whatever nesting the 8-column rule happens to give. Python rejects the same input with TabError. A sequence written in an editor that shows tabs as 4 columns therefore silently changes meaning: below, the author reads the last assignment as inside if b, but the compiler puts it inside if a only, so n ends at 10 and the assert fails at runtime on both backends.
a: bool = True
b: bool = False
n: I64 = 0
if a:
if b: # one tab
n = n + 1 # two tabs
n = n + 10 # eight spaces: dedents to `if a` for the compiler, looks like two tabs to the author
assert n == 0, 1
PythonIndentercounts a tab as 8 columns and never checks that the lines of a block use consistent indentation characters, so a file mixing tabs and spaces compiles with whatever nesting the 8-column rule happens to give. Python rejects the same input withTabError. A sequence written in an editor that shows tabs as 4 columns therefore silently changes meaning: below, the author reads the last assignment as insideif b, but the compiler puts it insideif aonly, sonends at 10 and the assert fails at runtime on both backends.