title: How much memory will a list with one million elements take up in Python?
body: <p>There are more than a million subreddits on Reddit, according to <a href="http://redditmetrics.com/history" rel="noreferrer">redditmetrics.com</a>.</p>
  
  <p>I wrote a script that repeatedly queries <a href="https://www.reddit.com/reddits.json" rel="noreferrer">this Reddit API endpoint</a> until all the subreddits are stored in an array, <code>all_subs</code>:</p>
  
  <pre><code>all_subs = []
  for sub in &lt;repeated request here&gt;:
      all_subs.append({"name": display_name, "subscribers": subscriber_count})
  </code></pre>
  
  <p>The script has been running for close to ten hours, and it's about halfway done (it gets rate-limited every three or four requests). When it's finished, I expect an array like this:</p>
  
  <pre><code>[
      { "name": "AskReddit", "subscribers", 16751677 },
      { "name": "news", "subscribers", 13860169 },
      { "name": "politics", "subscribers", 3350326 },
      ... # plus one million more entries
  ]
  </code></pre>
  
  <p><strong>Approximately how much space in memory will this list take up?</strong></p>