<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def primitives(self):
 """Generates a new `Assembly` containing the primitives of each Polymer. Notes ----- Metadata is not currently preserved from the parent object. Returns ------- prim_assembly : ampal.Protein `Assembly` containing only the primitives of the `Polymers` in the original `Assembly`. """

        prim_molecules = [
            p.primitive for p in self._molecules if hasattr(p, 'primitive')]
        prim_assembly = Assembly(molecules=prim_molecules, assembly_id=self.id)
        return prim_assembly