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

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to