[Python-Dev] PEP 3103: A Switch/Case Statement
robinbryce at gmail.com
Tue Jun 27 10:42:24 CEST 2006
> PEP 3103, When to Freeze the Dispatch Dict/Option 1
2 things resonated with me for Raymond's proposal and the follow up:
- It seemed agnostic to almost all of the independently contentious issues.
- "is defined tightly enough to allow room for growth and elaboration over
time" [Raymond]. In particular it left room for
const/static/only/cached/etc to come along later.
I think its worth acknowledging this in the PEP.
Is nothing better than something in this case ? I don't know.
> I think we need a PEP for const/static/only/cached/precomputed or
> whatever people like to call it.
> Once we have (say) static, I think making the case expressions static
> by default would still cover all useful cases, and would allow us to
> diagnose duplicate cases reliably (which the if/elif chain semantics
> don't allow IIUC).
If the expectation is that static/const will evolve as a sibling pep,
does this not make Raymond's suggestion any more appealing, even a
Is it unacceptable - or impractical - to break the addition of switch
to python in two (minor version separated) steps ?
More information about the Python-Dev