[gt-users] python iterators
Brent Pedersen
bpederse at gmail.com
Tue Sep 29 18:34:16 CEST 2009
hi, i've been looking at the python iterators and realized that the
iterating over featurenodes is not very idiomatic.
this is easily fixed by the patch below. it allows:
for feat in FeatureNodeIteratorDepthFirst(node):
print feat.type
instead of the old:
dfi = FeatureNodeIteratorDepthFirst(node)
feat = dfi.next()
while feat:
print feat.type
feat = dfi.next()
i've fixed all the unit tests in this patch, though it may break some
scripts that rely on the old behavior...
-brent
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iterators.diff
Type: text/x-diff
Size: 5325 bytes
Desc: not available
Url : http://genometools.org/pipermail/gt-users/attachments/20090929/a4c531fd/attachment.bin
More information about the gt-users
mailing list