Fixed #23838: LazyObject is missing __iter__

Adds the `__iter__` method in `LazyObject`. Unit tests for this are included.