3 ms·
Crikey, that's going to be confusing. Why not separate capture variables from comparison variables by using tuple-style brackets? RED = "red" colour = "gre
by bb101 6y ago
Crikey, that's going to be confusing. Why not separate capture variables from comparison variables by using tuple-style brackets?
RED = "red"
colour = "green"
match colour:
case (RED,):
print(f"The colour is {RED}")
> The colour is green
match colour:
case RED:
print(f"The colour is {RED}")
> The colour is red