Skip to content Skip to sidebar Skip to footer

Python3: Assertion 'iter_is_valid (iter, List_store)' Failed

I have a hard time upgrading from Python 2.7 to Python 3. Many many errors. The code below that worked perfectly in Python 2.7 now gives me an error: gtk_list_store_get_value: asse

Solution 1:

My question was answered here:

In Python 3, map returns an iterator, which you can only iterate over once. If you iterate over an iterator a second time, it will raise StopIteration immediately, as though it were empty. max consumes the whole thing, and min sees the iterator as empty. If you need to use the elements more than once, you need to call list to get a list instead of an iterator.

My program was built for Python 2, and I used a list of iters to refer to elements, that vanished in Python 3.

I still don't understand why Python 3 broke Python 2 in so many ways. Python 3 did not obey the most basic backward compatibility principles. Maybe someone here can explain me...

Post a Comment for "Python3: Assertion 'iter_is_valid (iter, List_store)' Failed"