title: How to get&handle a list of objects in another class?
body: <p>So I have a very simple "Customer" class which only stores the name and creates an id:</p>
  
  <pre><code>import secrets
  
  
  class Customer:
  
      def __init__(self, name):
          self.name = name
  
      def get_id(self):
          id = secrets.token_hex(20)
          return id
  </code></pre>
  
  <p>In another class my objective is to create a list where all the instances of Customer are stored and in all the functions in the class I need to handle either the name or the id of those customers.
  The two methods I've found so far are import gc and do something like this</p>
  
  <pre><code> for i in gc.get_objects():
        if isinstance(i, Customer):
             customer_list.append(i)
  </code></pre>
  
  <p>which I really dont understand and don't know if it works.</p>
  
  <p>The other way I've found is to use getmembers(), but again I still have no idea about the syntax in using this function and how the name and the id will be stored.</p>
  
  <p>Thanks in advance for any help!</p>