Re:Avoid Else, Return Early (2013)
by true_religion on Tuesday March 27, 2018 @12:24AM
(#16685227)
Just tried that---typing like mad in a wordpad, with 12 spaces of indentation, then copying into PyCharm and it worked.
Mixed spaces and tabs as a next go, and it worked too---converting the pasted tabs into spaces of my style.
Smart-tabbing is pretty smart.
Granted, I knew that so long as the indents were proper (i.e it compiles), that pasting at that point would give valid code but... I can't see how using braces would have been different. Just because it compiles, doesn't mean it works. I've pasted javascript incorrectly multiple time to produce valid, but incorrect for my needs code.
Mixed spaces and tabs as a next go, and it worked too---converting the pasted tabs into spaces of my style.
Smart-tabbing is pretty smart.
Granted, I knew that so long as the indents were proper (i.e it compiles), that pasting at that point would give valid code but... I can't see how using braces would have been different. Just because it compiles, doesn't mean it works. I've pasted javascript incorrectly multiple time to produce valid, but incorrect for my needs code.