Python is intentionally simple to parse. The whitespace thing (if that's what you're referring to) goes like this: if a line is indented one more level than the previous line, that span of indentation becomes an <indent> token, applied for the rest of the indented block. So to figure out scope level for a given line, look at the number of leading <indent> tokens. That's it. Google knows more.
If I've said it once I've said it a thousand times: Python cares about indentation not whitespace. You can format your code any way you please, but it turns out that arguments about where to place curly braces don't actually contribute to getting real work done, and Python people don't miss them.
Anyone?