This adds some ergonomics I was wishing for when using the various list-like containers in the Python bindings. The big feature is that you can now "slice" all the lists. For example, if you want to see the first few paths in a GFA:
for p in g.paths[:5]:
print(str(p))
Recall that g.paths is not a real Python list object, so g.paths[:5] doesn't construct a new list or otherwise eagerly fetch any paths. It just does the index math to give you a narrower view such that, when you eventually access items, you get the selected subrange.
This adds some ergonomics I was wishing for when using the various list-like containers in the Python bindings. The big feature is that you can now "slice" all the lists. For example, if you want to see the first few paths in a GFA:
Recall that
g.paths
is not a real Python list object, sog.paths[:5]
doesn't construct a new list or otherwise eagerly fetch any paths. It just does the index math to give you a narrower view such that, when you eventually access items, you get the selected subrange.