|
|
|
|
|
by prewett
174 days ago
|
|
I don't think it has anything to do with Python. I had plenty of 'if' errors in C++ caused by indenting the second line and not putting braces around it prior to Python. They were always painful to debug. I finally just _always_ put a brace around an 'if' block, regardless of whether it is one line or many, and I've never had that problem again. I think the problem is that C lets you omit the brace for one line; it should always require a brace. Python executes like it reads, which seems like a positive feature to me. Makes errors like C's two-line if block impossible. |
|