Is there a more elegant way to spell this?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Jan 27 21:16:30 EST 2015


Mario Figueiredo wrote:

> In article <54c8339f$0$13008$c3e8da3$5496439d at news.astraweb.com>,
> steve+comp.lang.python at 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

That's third-party documentation, not official, and I strongly disagree with
a couple of those recommendations. But this specific one seems reasonable
enough.


-- 
Steven




More information about the Python-list mailing list