[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
Thu Jun 5 17:55:02 UTC 2008


------- Comment #7 from cracka80 at gmail.com  2008-06-05 13:55 EST -------
I understand your approach that these functions should be converted to modern
Python, but it must also be remembered that Biopython as a whole is Python
2.3-compatible, so care must be taken not to modernise code too much. I can't
remember when iterators were phased in, but it should be possible, I think it
was around 2.2 anyway.

(In reply to comment #6)
> 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