Mario Figueiredo <mar...@gmail.com> writes: > In article <54c8339f$0$13008$c3e8da3$54964...@news.astraweb.com>, > steve+comp.lang.pyt...@pearwood.info 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: > http://docs.python-guide.org/en/latest/writing/style/#idioms
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 -- https://mail.python.org/mailman/listinfo/python-list