Avoid loops when going through objects and iterables.
Better support for Python3.