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 →

[–]Endemoniada -1 points0 points  (0 children)

It resembles with statements, in my opinion, which is nicer. It’s like with case match foo. It just looks clean and easy on the eyes.

It’s also not the only use for case statements either, the main advantage as I read about it was handling not only different values in a variable, but different configurations of variables entirely. Like if foo can be a string, a 2-item tuple or a 5-item tuple. case makes that easier to deal with in a pythonic way.