3 ms·
I 100% agree with you, but as a minor counterpoint, let me present you where an indentation might be a problem. I teach python (to my friends lol, not professio
by gnulinux 8y ago
I 100% agree with you, but as a minor counterpoint, let me present you where an indentation might be a problem. I teach python (to my friends lol, not professionally) and a new learner apparently debugged this "for hours" (probably just 20 minutes).
class A:
def some_method(self):
return # something
def some_func(foo, bar):
return # something
def some_other_method(self):
return # something
They intended to make `some_other_method` a method of class `A` instead they ended up writing `some_func` the wrong place and python parser was happy. For everyone except extreme python beginners debugging this will take 10 seconds. But just a datapoint.
- jMyles 8y agoYes, now that's a legitimate demonstration of a possible weak point of syntactic indentation. But it's easily fixed with code collapsing tools or a structure viewer (both of which are provided in all of the major python IDEs).