30 Oct
2019
30 Oct
'19
1:45 p.m.
Hi, I often have this pattern in Python: ``` for vertex in mygraph.vertices(): if not mygraph.vp.is_foo[vertex]: continue do_stuff_that_uses_all_vertices() ``` `is_foo` is a boolean property. I know that there a vertex filters and GraphViews but in the loop body I need access to all vertices. Only the iterator should be filtered. Is there a way to specify a vertex filter only in the vertices iterator? Something like: ``` for vertex in mygraph.vertices(vfilt=mygraph.vp.is_foo): do_stuff_that_uses_all_vertices() ``` Of course, this would be nice in all iterators (edges(), out_edges(), ...) ;). Best, Gerion