title: Using a Python Class to share data between Python scripts
body: <p>I am wondering if it makes sense in Python to use a class containing a list as if it is an in-memory database.</p>
  
  <pre><code>class MyData(object):
      def __init__(self):
          self._data = ['apple', 'orange', 'banana']
  
      @property
      def data(self):
          return self._data
  
      @classmethod
      def append(self, item):
          self._data.append(item)
  </code></pre>
  
  <p>Here's the scenario:</p>
  
  <p>A first python script <code>a.py</code> will import this class <code>MyData</code> and use the data in its list.</p>
  
  <p>A second python script <code>b.py</code> continuously  poll an online API in an infinite loop, imports this same class and appends more items to the list.</p>
  
  <p>When <code>a.py</code> runs another time, it should be able to read the newly added items in the list.</p>
  
  <p><strong>Question:</strong> Is this a good idea, or are we better off using a real database like MySQL/redis?</p>
  
  <p><strong>Update</strong>: The data does not need to be persisted to disk</p>