[Biopython-dev] [Biopython - Bug #3358] (New) Bio.PDB.Atom does not copy xtra dictionary

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Mon May 21 03:30:49 UTC 2012


Issue #3358 has been reported by Alexander Campbell.

----------------------------------------
Bug #3358: Bio.PDB.Atom does not copy xtra dictionary
https://redmine.open-bio.org/issues/3358

Author: Alexander Campbell
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 
URL: 


The Bio.PDB.Atom.copy function does not copy the object's xtra dictionary, leading to the source and the copy Atom objects sharing the same xtra dictionary. This can be observed by calling the id() function on the xtra attribute in the source and copy Atom objects, or more practically by copying an Atom object, adding a value to the copy's xtra dict, and observing that the same value is now present in the source's xtra dict.

The fix is to have the Bio.PDB.Atom.copy function call copy.copy() function on the self.xtra dict, as does the Bio.PDB.Entity.copy function. The copied Atom object's xtra dict is now a copy of the source Atom object's xtra dict, and behaves as expected.


----------------------------------------
You have received this notification because this email was added to the New Issue Alert plugin


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org




More information about the Biopython-dev mailing list