Donovan Baarda wrote:

Agreed. I don't find any switch syntaxes better than if/elif/else. Speed
benefits belong in implementation optimisations, not new bad syntax.


Two things are mildly annoying about if-elif chains as a substitute for a switch statement:

1) Repeating the name of the thing being switched on all the time,
   and the operator being used for comparison.

2) The first case is syntactically different from subsequent ones,
   even though semantically all the cases are equivalent.

--
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,          | A citizen of NewZealandCorp, a       |
Christchurch, New Zealand          | wholly-owned subsidiary of USA Inc.  |
[EMAIL PROTECTED]          +--------------------------------------+
_______________________________________________
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

Reply via email to