title: Python TypeError: 'set' object is not subscriptable
body: <pre><code>def create(ids):
      policy = {
          'Statement': []
      }
      for i in range(0, len(ids), 200):
          policy['Statement'].append({
              'Principal': {
                  'AWS': list(map(lambda id: f"arn:aws:iam::{id}:root", ids[i:i + 200]))
              }
          })
      return policy
  </code></pre>
  
  <p>when I make a function call to this method <code>create({'1','2'})</code> I get an <code>TypeError: 'set' object is not subscriptable</code> error on line 
  <code>'AWS': list(map(lambda id: f"arn:aws:iam::{id}:root", ids[i:i + 200]))</code>. 
  Coming from a java background, is this somehow related to typecasting? 
  Does the error mean that I'm passing a set data structure to a list function?
  How could can this be resovled?</p>