There's a huge difference in desirability for white space significance depending on whether or not it is used for code or data storage.
Because the best practice is to decompose your code in functions and classes, space significance isn't so much a problem in Python.
YAML on the other hand, is a visually atrocious way to store tree-like/multi-layered data.