[Python-3000] Switch and static, redux
Guido van Rossum
guido at python.org
Wed Jul 5 16:56:19 CEST 2006
On 7/5/06, Andrew Clover <and-dev at doxdesk.com> wrote:
> Guido van Rossum <guido at python.org> wrote:
>
> > (I'm not super confident about the syntax alternatives yet.)
>
> The switch:-without-indent business still naggingly makes me feel
> uncomfortable.
Me too, but only on even-numbered days...
> Is this a valid no-case-switch?
>
> switch cake:
> print 'hello'
No. A switch must have one or more case suites and then optionally an
else suite.
> Here's another syntax off the top of my head - put the first case in the
> switch statement?
>
> switch biscuit.type if 'digestive':
> ...
> elif in 'jammy_dodger', 'garibaldi':
> ...
> else:
> ...
Ah please. If you *have* to make up new syntax from a random jumble of
keywords, at least make it a bit fun, like Barry's "as if" proposal in
another thread. :-)
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list