[Biopython-dev] [Bug 2454] Iterators can't use file-like objects

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Jun 3 11:46:58 UTC 2008


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





------- Comment #5 from cracka80 at gmail.com  2008-06-03 07:46 EST -------
(In reply to comment #4)
> I agree that type checking is a problem.
> I am not sure if a specialized function in Bio.File is a good idea. The
> question is not if "this object is a file-like object", but "does this object
> have the attributes/methods needed". So I would prefer to add checks only for
> the required attributes/methods in each of the iterators.
> 

The function I have written does exactly this - it checks for the necessary
attributes and methods for a given object. The iterators would then only need
to call ``File.is_filelike()`` on each object passed into them, rather than a
type checking procedure. This is in accordance with the design pattern "Program
to an 'interface', not an 'implementation'." (Gang of Four). Would you like me
to provide a diff against the current revision of Biopython, with suggested
changes?


-- 
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