On Thursday 2005-07-21 01:22, Martin Blais wrote: > The Rule of Least Surprise says to me that "while:" would do the least > unexpected thing. There are only two possibilities: the test is > implicitly false, in which case "while:" would make no sense (i.e. the > block would be ignored). Therefore the other only sensible case is > that the test is implicitly true, which can be useful (and also > happens to be a very common idiom).
To me, the "least unexpected thing" for "while:" to do is to raise a syntax error. The principle of least surprise doesn't mean that for every sequence of tokens you should pick the least surprising thing it could do, and give it that definition. (That's what they do in C++, except for the bit about picking the least surprising semantics.) -- g _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com