title: Shallow or deep copy in a list comprehension
body: <p>If you have a list (Original) in python like:</p>
  
  <pre><code>class CustomID (object):                   
      def __init__(self, *args):
          self.ID = ''
          self.manymore = float()
          self.visited = False
          self.isnoise = False
  IDlist = ['1','2','3','4','5','6','7','8','9','10']
  Original = list()
  for IDs in IDlist:
      NewObject = CustomID()
      NewObject.ID = IDs
      Original.append(NewObject)
  </code></pre>
  
  <p>and if you do a comprehension for a new list and a function to use over the comprehension sublist:</p>
  
  <pre><code>def Func(InputList=list()):
      for objects in InputList:
          objects.visited = True
      return InputList
  New_List = [member for member in Original if (int(member.ID)&gt;5)]
  ThirdList = Func(New_List)
  </code></pre>
  
  <p>Is this (New_List) resulting in a shallow or deep copy of the original list? The matter is relevant for me, if the original list contains objects, which attributes can change in the code to follow New_List creation (ThirdList). New_list is send to a function, which will change the attributes. The question is if you try to reuse the original list for the same function with different comprehension (lets say (members>4).</p>
  
  <pre><code>New_List = [member for member in Original if (int(member.ID)&gt;4)]
  </code></pre>
  
  <p>Actually:</p>
  
  <pre><code>print New_List[3].visited
  </code></pre>
  
  <p>gives True.</p>