conditional-expressions

Why isn't this a syntax error in python?

Why isn't this a syntax error in python? Question: Noticed a line in our codebase today which I thought surely would have failed the build with syntax error, but tests were passing so apparently it was actually valid python (in both 2.x and 3). Whitespace is sometimes not required in the conditional expression: >>> 1if …

Total answers: 3