News for hackers. Stuff that matters.
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:

  NOT_FOUND = 404
  match get_status():
      case NOT_FOUND:
          print("Here")
          # this actually assigns to the global NOT_FOUND
          # and is effectively the default case
      case _:
          # this never gets triggered
          print("There")
I got a meaningful error:

    File "<ipython-input-13-5264d8327114>", line 3
      case NOT_FOUND:
         ^
  SyntaxError: name capture 'NOT_FOUND' makes remaining patterns unreachable
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