I discovered in the Maya API documentation that the iterators - for example the MItSelectionList - can be initialized in a Python fashion using the iter() function, and that you can then move the iterator using iternext(). But how does this work precisely? I’m doing an x-in-list, printing x and all I get is a reference to the iterator itself!
from maya.api import OpenMaya as om
_ = om.MSelectionList()
_.add("pCube2")
_.add("pCube3")
_.add("pCube4")
sel_itr = om.MItSelectionList(_).iter()
for x in sel_itr:
print(x)
# <OpenMaya.MItSelectionList object at 0x0000023310727468>
# <OpenMaya.MItSelectionList object at 0x0000023310727468>
# <OpenMaya.MItSelectionList object at 0x0000023310727468>