title: random.choice broken with dicts
body: <p>The <code>random.choice</code> input is supposed to be a <a href="https://docs.python.org/3/glossary.html#term-iterable" rel="nofollow noreferrer">sequence</a>. This causes odd behavior with a <code>dict</code>, which is not a sequence type but can be subscripted like one:</p>
  <pre><code>&gt;&gt;&gt; d = {0: 'spam', 1: 'eggs', 3: 'potato'}
  &gt;&gt;&gt; random.choice(d)
  'spam'
  &gt;&gt;&gt; random.choice(d)
  'eggs'
  &gt;&gt;&gt; random.choice(d)
  'spam'
  &gt;&gt;&gt; random.choice(d)
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
    File &quot;/usr/lib/python2.7/random.py&quot;, line 274, in choice
      return seq[int(self.random() * len(seq))]  # raises IndexError if seq is empty
  KeyError: 2
  </code></pre>
  <p>Additionally <code>random.choice</code> doesn't work at all on a <code>set</code>, and some other containers in the <code>collections</code> module.</p>
  <p>Is there a good reason why <code>random.choice(d)</code> shouldn't just work in the obvious way, returning a random key?</p>
  <p>I considered <code>random.choice(list(d))</code> and <code>random.sample(d, 1)[0]</code> but hope there may be more efficient methods. Can <code>random.choice</code> be improved without degrading the current behavior on sequences?</p>