title: Cached string lists convert to lists
body: <p>I have cached lists that contains words. I download the lists from the cache memory as string types. Does anyone know how can i convert them to lists again?</p>
  
  <p>1st list as string</p>
  
  <pre><code>b"['cat', 'dog']"
  </code></pre>
  
  <p>and i want it in this formation</p>
  
  <pre><code>['cat','dog']
  </code></pre>
  
  <p>as list.</p>
  
  <p>I already try:</p>
  
  <pre><code>for lists in petlist:
      x = lists.decode("utf-8") 
      x = x.replace('[','')
      x = x.replace(']','')
      resources = b.split (',')
  
      if ',' in x:
          x = x.split(',')
      print(x)
  </code></pre>
  
  <p>Any ideas?</p>