Two variable dictionary comprehension

Jerry Hill malaclypse2 at gmail.com
Mon Apr 3 16:47:57 EDT 2017


On Mon, Apr 3, 2017 at 10:30 AM, Deborah Swanson
<python at deborahswanson.net> wrote:
> Regular updates as the docs are updated would be a good idea too. It's
> obvious that today's Google isn't up to it, although it occurs to me
> that I haven't tried Google's site search on python.org.

So, when you search google for the phrase "dict comprehension" or
"dictionary comprehension", nothing useful comes up for you?  When I
search either of those phrases, I get lots of useful results, all of
which spell out how to do what you were originally asking about.  I
know Google search results are skewed by past usage, but I'm surprised
that you didn't find anything useful in the first couple of search
results.

When I do a search for 'dict comprehension' I get a boxed result
linking to PEP 274 as the first hit, then two Stack Overflow
questions, both of which demonstrate how to do dictionary
comprehensions.  Following that is another link to PEP 274, a link to
the Python docs on data structures (which does talk about dict
comprehensions, but it's way down on the page), and then links to a
bunch of tutorials.  If you had to judge based on my search results,
Google does a fine job of answering python questions, at least when
you already know the key phrase to look for.

-- 
Jerry


More information about the Python-list mailing list