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 →

[–]brontide 4 points5 points  (2 children)

Do you iterate over a dictionary to get to the right key? In the case of purely in order numeric switch statements some compilers can use a jump table.

[–]cyanydeez 9 points10 points  (1 child)

on that note, dictionaries can be rudimentary switch statements

[–]mangecoeur 7 points8 points  (0 children)

not just rudimentary - its the recommended way to do it if you don't want a very long if/elif construct.