[BioPython] RecordFile
Andrew Dalke
dalke@acm.org
Wed, 27 Jun 2001 02:36:31 -0600
Cayte:
>> The implementation is based on a state machine. and assumes sequential
>> access
Ramu:
>subsequent call should return the next record and empty string should be
>used to mark for end of file. Something like
>
> while 1:
> e = db.nextrecord()
> if not e:
> break
Hmm, and I did two different ways to do the same thing for Martel;
the current "make_iterator" method and the experimental threaded
version which turns a set of SAX callbacks into a record.
You all might want to look at two new features for Python 2.2,
"Iterators" http://python.sourceforge.net/peps/pep-0234.html and
"Simple Generators" http://python.sourceforge.net/peps/pep-0255.html
It should make it easier to use state-machine-based functions
and to read through records of a database or data file.
Andrew
dalke@acm.org