On Sat, 23 Jul 2016 16:13:58 +0300 Marko Rauhamaa <ma...@pacujo.net> wrote: > "D'Arcy J.M. Cain" <da...@vex.net>: > > It's ambiguous to the reader what was actually meant. Forcing a > > "pass" there shows the reader that the empty block was not a > > mistake. > > Just let the syntax speak for itself. The code means what the language > definition says it means.
Exactly so given this... for x in sequence: print("Something") If the language allowed that then we know exactly what the programmer said. What we don't know is what the programmer meant. The above is a simple and obvious statement but real code is more complicated. Add a few comments and a little nesting and what used to be obvious isn't. The interpreter would still know what the programmer said but without the pass requirement it is easier for it to be not what he meant. Python has some nice features like this one that protect the programmer and allow much faster development because there is a safety net. If you like knives without handles you know where to find Perl. Gotta go. The metaphor police are at the door. -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:da...@vex.net VoIP: sip:da...@vex.net -- https://mail.python.org/mailman/listinfo/python-list