[Networkit] Exporting NetworKit Iterators to Python
michael.hamann at kit.edu
Mon Apr 27 13:38:32 CEST 2015
Dear NetworKit developers,
as I wanted a way to iterate over all edges of a graph in Python that also
allows me to use edge ids without requesting each edge id separately, I added
some Cython code which exports Graph::forEdges() to Python. I'm not totally
happy, especially as it needs a C macro in order to work. I already asked in
the cython-users list  how to do this without C macro, but unfortunately
haven't got any reply so far. Furthermore I almost directly exported the
method to Python which means that you do not get a Python iterator but a
method which takes any Python callable (like a lambda or also a regular
method) as argument.
I still think this might be useful for some and also a good starting point for
implementating real Python iterators for our NetworKit iterators in Cython so
I'm attaching a patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2190 bytes
Desc: not available
More information about the NetworKit