4 ms·
By the way, does anyone here know how Python compiles the match statements under the hood? Are they converted into something equivalent to if-elif, which tries
by ufo 5y ago
By the way, does anyone here know how Python compiles the match statements under the hood? Are they converted into something equivalent to if-elif, which tries each option in sequence? Or does it do something more clever?
- mixmastamyk 5y agoThe author replied here that yes, the bytecode is simple, with the exception of the Class matching. https://news.ycombinator.com/threads?id=benhoyt https://news.ycombinator.com/threads?id=benhoyt