What exactly are views in Python3.1? They seem to behave in a similar manner as that of iterators and they can be materialized into lists too. How are iterators and views differ
I would recommend that you read this. It seems to do the best job of explaining.
As far as I can tell, views seem to be associated more with dict
s and can be forced into list
s. You can also make an iterator out of them, through which you could then iterate (in a for
loop or by calling next
)
Update: updated link from wayback machine