News for hackers. Stuff that matters.
Re:Pattern matching accepted for Python by heisenzombie on Wednesday February 10, 2021 @01:51AM (#26086297)
Elixir uses the “pin operator”

“Use the pin operator ^ when you want to pattern match against a variable’s existing value rather than rebinding the variable.”

    iex> not_found = 404
    404
    iex> ^not_found = 200
    ** (MatchError) no match of right hand side value: 200
https://elixir-lang.org/getting-started/pattern-matching.htm...
Re:Pattern matching accepted for Python by pfalcon on Wednesday February 10, 2021 @05:21AM (#26087471)
Exactly, Elixir is usually the only example given. So, how it makes sense to blame Python here is unclear. There's a proposal to add similar "sigils" to Python pattern matching, it just didn't make it yet.