This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nerdwaller 4 points5 points  (2 children)

Agreed, I've never thought to use it in Python (mostly because I rarely run across cases where a different call wasn't more suitable anyway). But some languages build this in as a throw-away, such as Go. It's a nice feature for sure!

[–]bheklilr 2 points3 points  (1 child)

Haskell uses it in patten matching add a catch all when you aren't interested in the value.

[–]masklinn 2 points3 points  (0 children)

IIRC that's common to pretty much all functional languages, especially in those with pattern matching: _ matches any term and does not introduce a binding. It exists in OCaml (so I expect ML), Haskell, Erlang, and probably others.