Re:Pattern matching accepted for Python
by EwanToo on Wednesday February 10, 2021 @04:32AM
(#26087168)
For what it's worth, I tried a modified version of the first example you've used above in the sandbox:
I got a meaningful error:
[ Parent
| on HN ]
Re:Pattern matching accepted for Python
by hyperbovine on Wednesday February 10, 2021 @08:01AM
(#26088511)
That in itself is weird though. Why throw a syntax error there but not here?:
def f(x):
return 1
y = x + 1
return y