How to use values stored in variables as case patterns?
How to use values stored in variables as case patterns? Question: I’m trying to understand the new structural pattern matching syntax in Python 3.10. I understand that it is possible to match on literal values like this: def handle(retcode): match retcode: case 200: print(‘success’) case 404: print(‘not found’) case _: print(‘unknown’) handle(404) # not found …