title: How to initialize two attributes of type list with the same list?
body: <pre class="lang-py prettyprint-override"><code>class Bins: 
     
      def __init__(self, id:str, initial_list:list):
          self.id_ = id
          self.capacities = initial_list 
          self.remaining_capacities = initial_list
          
  example = Bins(&quot;t1&quot;,[0,0,1])
  example.capacities[1] = 1
  print(example.remaining_capacities) # gives [0, 1, 1]
  
  </code></pre>
  <p>As shown, the problem with this approach is that I cannot modify the attributes independently.</p>