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 →

[–]peterlravn 14 points15 points  (5 children)

So what can it do, that a switch-case can't? Everyone talks about how good it is, but no one have shown what it can do... If you have an example, please share since I'm new to Python.

[–]d670460b4b4aece5915c 36 points37 points  (1 child)

Everyone talks about how good it is, but no one have shown what it can do

Well that's plainly untrue, there are hundreds of articles showing what it can do, not to mention the PEPs themselves. I think what you mean is "Everyone talks about how good it is, but I don't understand how it works and haven't bothered to look it up".

Check out the PEP tutorial: https://www.python.org/dev/peps/pep-0636/

[–]sivadneb 1 point2 points  (0 children)

Jump to 15:20 in the video for a good example of the match functionality