Is there a more elegant way to spell this?

Ben Finney ben+python at
Wed Jan 28 02:29:18 CET 2015

Mario Figueiredo <marfig at> writes:

> In article <54c8339f$0$13008$c3e8da3$5496439d at>, 
> steve+comp.lang.python at says...
> > (3) _ is also commonly used as a "don't care" variable name:
> > 
> > a, _, b, _ = get_four_items()  # but I only care about two of them
> > 
> According to the following link, it is actually a double underscore:

More accurately (and as acknowledged in that guide), a single underscore
*is* a common name for a “don't care” name, but is better avoided for
that purpose because it's also commonly used for other purposes.

In other words: That guide is correct in its admonition, but that
doesn't challenge what Steven said about common usage.

 \       “My business is to teach my aspirations to conform themselves |
  `\              to fact, not to try and make facts harmonise with my |
_o__)                   aspirations.“ —Thomas Henry Huxley, 1860-09-23 |
Ben Finney

More information about the Python-list mailing list