[Python-3000] Switch and static, redux

Ka-Ping Yee python at zesty.ca
Fri Jul 7 10:04:53 CEST 2006


On Wed, 5 Jul 2006, Guido van Rossum wrote:
> So, my proposal is to give up on static, accept PEP 3103 with the
> following options:
>   - Syntax alternative 2+B (unindented cases, 'case in ...' for
>     multiple cases).
>   - Semantics option 3 (def-time freezing)
>
> Do we need any more discussion about the PEP before I pronounce? (I'm
> not super confident about the syntax alternatives yet.)

I think i'd argue for indented cases, mainly because it's what
everyone expects.  "Everyone" includes

  - people who have seen 'switch' in other languages
  - people who expect ':' to introduce an indented block
  - editors that autoindent new lines
  - editors that fold indented blocks
  - editor hotkeys/macros for manipulating indented blocks
  - tools that highlight Python code
  - interactive Python consoles

Unindented cases are not exactly the Spanish inquisition :) but
in a room full of programmers who have ever used C, C++, C#, Java,
or JavaScript, it's pretty close.


-- ?!ng


More information about the Python-3000 mailing list