-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip nonrelevant case
s in match/case
during step by step debugging
#1565
Comments
In C, the values in case labels are all constant expressions, so the only evaluation that needs to take place at runtime is that of the switch expression. In Python, however, every pattern actually needs to be matched against the object at runtime in sequence, as patterns can contain arbitrary expressions in them which aren't evaluated until all previous patterns failed to match. So it's fundamentally a different construct semantically even if it looks similar for simple cases. |
Currently I use following trick:
|
Thanks for the update @Real-Gecko, unfortunately, the method you are using is the way to do it, because of what @int19h said earlier - Each case is treated as an individual block, causing the debugger to stop on every case during step-by-step debugging (F10). |
When debugging C application inf VSCode I've noticed that step by step debugging(F10) through
switch/case
"jumps" immediately to the matched case.OTOH while debugging Python's
match/case
debugger is stopped on everycase
statement so you have to spam F10 constantly to get to the proper condition and continue execution.Anyway to prevent this from happening?
The text was updated successfully, but these errors were encountered: