[Biopython-dev] [Bug 2879] missing __delitem__ in Bio.PDB.Entity.Entity

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Sat May 29 19:31:56 UTC 2010


http://bugzilla.open-bio.org/show_bug.cgi?id=2879





------- Comment #4 from eric.talevich at gmail.com  2010-05-29 15:31 EST -------
grep tells me that the only place "__delitem__" appears in Bio/PDB/ is in
Chain.py: the definition of Chain.__delitem__, and the call to the nonexistent
Entity.__delitem__.

The method would be required for this do work:

struct = PDBParser().get_structure('asdf', 'ASDF.pdb')
del struct[0]

This seems useful, since __getitem__ is already implemented, but I can't
imagine it functioning any differently than detach_child.

Solution 1: Comment out Chain.__delitem__, since they're no way this ever
worked for anybody.

(
http://github.com/etal/biopython/commit/835b444df6b7f2c63b427535bc1c796c26ccce60
)

Solution 2: Implement Entity.__delitem__, essentially identical to
Entity.detach_child. Look at the implementations of __getitem__ in the other
subclasses of Entity to see if anything fancy needs to be done to support
__delitem__ in each of them.

(to do)


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list