value = <dict>.pop(key) <spanclass="hljs-comment"># Removes item or raises KeyError if missing.</span>
{k <spanclass="hljs-keyword">for</span> k, v <spanclass="hljs-keyword">in</span><dict>.items() <spanclass="hljs-keyword">if</span> v == value} <spanclass="hljs-comment"># Returns set of keys that point to the value.</span>
{k: v <spanclass="hljs-keyword">for</span> k, v <spanclass="hljs-keyword">in</span><dict>.items() <spanclass="hljs-keyword">if</span> k <spanclass="hljs-keyword">in</span> keys} <spanclass="hljs-comment"># Returns a dictionary, filtered by keys.</span>
{k: v <spanclass="hljs-keyword">for</span> k, v <spanclass="hljs-keyword">in</span><dict>.items() <spanclass="hljs-keyword">if</span> k <spanclass="hljs-keyword">in</span> keys} <spanclass="hljs-comment"># Filters the dictionary by keys.</span>