
12 Jul
2020
12 Jul
'20
10:14 a.m.
Federico Salerno wrote:
On 11/07/2020 19:29, Jim J. Jewett wrote:
To me, "else:" has a slightly different meaning than "case _:" ...
Could you construct two examples to prove behaviour would be different between the two?
The behavior would be identical; the difference is in why I put that behavior there.
match return_code: case -1: ... case 4: ... case x if int(x) == x: pass # This could be a "case _" if not for the guard else: raise TypeError("Return Code not an integer?!?: ", return_code)