http://www.perlmonks.org?node_id=867929


in reply to perl equivalent of python's underscore?

Your question has more to do with scoping and syntax.
Scope:
Python scoping is not like Perl's. It's similar, but forget about 'brackets'. It's about function defs and where they happen.
Syntax:
The underscore '_' in Python is not special, it just happens to be a valid variable name. In conjunction with scoping, this has become short-hand for for a 'disposable' variable. Given the 'fill the slots' nature of assignment in Python, this turns out to be pretty useful, and therefore an idiomatic pythonic thing to do.

And yes, I've had to go play on the dark side here and there.

Cheers,
Matt

  • Comment on Re: perl equivalent of python's underscore?