Guido van Rossum wrote: > On 6/22/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> Guido van Rossum wrote: >> >> >> I've also been wondering whether the 'case' keyword is really necessary? >> >> Would any ambiguities or other parsing problems arise if you wrote: >> >> >> >> switch x: >> >> 1: foo(x) >> >> 2: bar(x) >> >> >> >> It is debatable whether this is more or less readable, but it seemed >> >> like an interesting question for the language lawyers. >> > >> > That's no problem for the parser, as long as the expressions are >> > indented. ABC did this. >> > >> > But I think I like an explicit case keyword better; it gives a better >> > error message if the indentation is forgotten. >> >> It also overthrows the notion that suites are started by statements, not >> by expressions. > > I'm not sure I care about that. Do you use this in teaching? How does > it help you?
I just realized that my post could be misunderstood: The sentence referred to the "case"-less form. (And it's just a "feeling" thing) Georg _______________________________________________ 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