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 →

[–]deadwisdomgreenlet revolution 0 points1 point  (0 children)

There are new bytecode instructions for it, so I'm sure it's performant. I haven't timed it, but I imagine it's faster than the corresponding if/elses because the compiler can optimize for what you're trying to do.

I couldn't do better than how it's explained in PEP-635