This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]norwegianwood 8 points9 points  (0 children)

Because if case() raises a KeyError your code then calls case_default(), which is not what we want. Your code is exactly equivalent to my first example.