[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 15:07:35 UTC 2008


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





------- Comment #6 from mdehoon at ims.u-tokyo.ac.jp  2008-06-03 11:07 EST -------
Two things:
1) Some of the code that does type checking for file-like-ness seems to be
quite old and possibly outdated (e.g. Gobase.Iterator). We should take this
opportunity  to go through these modules and check if they are still useful.
2) Many of these modules (especially the ones that use an "Iterator" class)
would be written differently in modern Python (in particular by making use of a
generator function instead of an Iterator class).

So I'd like to suggest the following:
-) For the modules whose usability is dubious in 2008, let's check on the
mailing list if anybody is still using them. If not, we can simply deprecate
them.
-) For the modules that are still useful, use try/except clauses to check for
the necessary attributes. The current function checks for 'read', 'readline',
'readlines', and '__iter__', whereas the parser probably only needs one of
them. 
-) If possible, I'd prefer to convert to modern Python as much as possible
(though formally that is not within the scope of this bug report).


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