BartC <[email protected]>:
> On 16/03/2016 11:07, Mark Lawrence wrote:
>> but I still very much doubt we'll be adding a switch statement --
>> it's a "sexy" language design issue
>
> That's the first time I've heard a language feature common in C
> described as sexy.
Scheme has a "switch" statement (a "case" form). However, it is slightly
better equipped for it than Python:
* Scheme has an atom type ("symbol"). It corresponds to interned
strings and is supposed to be compared by reference.
* Scheme has defined three equality operators: "eq?", "eqv?" and
"equal?". Python only has two: "is" (~ "eq?") and "==" (~ "equal?").
The "case" form makes use of the operator "eqv?" that is missing from
Python ("eqv?" compares numbers numerically but is otherwise the same
as "eq?").
Marko
--
https://mail.python.org/mailman/listinfo/python-list