commit rBeb8964fb7f19: Fix T41464: Material Boundary bug in Freestyle exposed a problem in the current freestyle iterator code.
to illustrate, the following code would previously raise a StopIteration during the final iteration:
stroke = get_test_stroke()
it = Interface0DIterator(stroke)
while not it.is_end:
next(it)really, the above code should work as expected, end normally and leave an iterator object for which (it.is_end == True). To this end an isLast method has been implemented for Interface0DIterator, which is true if and only if the iterator points to the final valid element of the iterator.
The is_end method has been overloaded to use isLast for BPy_StrokeVertex- and BPy_Interface0DIterator. This should fix the current problems and make iterators safer for future development.
additionally, isLast is now used in the next() method, which makes for some nicer code there.