This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Switch syntax (partial PEP 275)
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, krumms
Priority: normal Keywords: patch

Created on 2006-06-11 02:13 by krumms, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python_switch_20060611_1.diff krumms, 2006-06-11 02:13 Python switch patch v1
Messages (2)
msg50458 - (view) Author: Thomas Lee (krumms) (Python committer) Date: 2006-06-11 02:13
Attached is a partial implementation of PEP 275.

It should offer a slight performance enhancement over
if/elif/else, although it won't be nearly as fast as a
lookup table generated at compile time (as the PEP
suggests). However, it is more flexible than a
compile-time generated lookup table in that it accepts
expressions - not just constants - for each case clause.

No new opcodes were added.

Cheers,
Tom
msg50459 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-03-13 20:08
The PEP was rejected, so rejecting the patch.
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43486
2006-06-11 02:13:11krummscreate